Repository navigation
Conversation
PVince81
commented
Jun 3, 2020
- PROBLEM: how to get at the actual file name, need to read the upload info file
- PROBLEM: cannot return headers as tusd is already sending the response
|
This won't work because the writeHeader method flushes the cache. But we could wrap the |
| w.ResponseWriter.WriteHeader(w.statusCode) | ||
| } | ||
|
|
||
| func (w *WrappedResponseWriter) Header() http.Header { |
There was a problem hiding this comment.
exported method WrappedResponseWriter.Header should have comment or be unexported
| // delay this | ||
| } | ||
|
|
||
| func (w *WrappedResponseWriter) SendResponse() { |
There was a problem hiding this comment.
exported method WrappedResponseWriter.SendResponse should have comment or be unexported
| statusCode int | ||
| } | ||
|
|
||
| func (w *WrappedResponseWriter) WriteHeader(statusCode int) { |
There was a problem hiding this comment.
exported method WrappedResponseWriter.WriteHeader should have comment or be unexported
| storage storage.FS | ||
| } | ||
|
|
||
| type WrappedResponseWriter struct { |
There was a problem hiding this comment.
exported type WrappedResponseWriter should have comment or be unexported
|
I've pushed an attempt to wrap the response. It works and I'm able to add headers after the TUS handler now. The next challenge is finding the path to pass to the CS3 API's And then I get a structure like this: but I haven't figured out how to resolve the correct path reference to pass the the CS3 API. @butonic any hints ? |
|
@labkode sounds good. Note that this is mostly driven by client development, as the old protocol had these fields returned at the end of the upload to avoid having to do subsequent calls (which are tricky for example on iOS) |
I've been through TUS and started refactoring code in #828. Upon this task I've found a fundamental problem on the various implementations of TUS for the storages. By extending the interface with the For example, if your filesystem exposes to the storage provider the path So, the current implementations need to store the upload information under the configured root, that will allow to call GetMD and avoid that hack for example. Passing internal implementation details to upper layers is a no-go. |
|
won't be continued here |