Skip to content

Commit

Permalink
fix tus with transfer token only (#1941)
Browse files Browse the repository at this point in the history
  • Loading branch information
wkloucek authored Dec 2, 2021
1 parent dd009dc commit 046c3d5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/tus-upload-with-transfer-token-only.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Fix TUS uploads with transfer token only

TUS uploads had been stopped when the user JWT token expired, even if only the transfer token should be validated. Now uploads will continue as intended.

https://github.com/cs3org/reva/pull/1941
3 changes: 0 additions & 3 deletions cmd/reva/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,6 @@ func uploadCommand() *command {
if err != nil {
return err
}
if token, ok := ctxpkg.ContextGetToken(ctx); ok {
c.Header.Add(ctxpkg.TokenHeader, token)
}
c.Header.Add(datagateway.TokenTransportHeader, p.Token)
tusc, err := tus.NewClient(dataServerURL, c)
if err != nil {
Expand Down
4 changes: 3 additions & 1 deletion internal/http/services/datagateway/datagateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ func (s *svc) Handler() http.Handler {
}

func (s *svc) Unprotected() []string {
return []string{}
return []string{
"/",
}
}

func (s *svc) setHandler() {
Expand Down
4 changes: 3 additions & 1 deletion internal/http/services/dataprovider/dataprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ func (s *svc) Close() error {
}

func (s *svc) Unprotected() []string {
return []string{}
return []string{
"/tus",
}
}

func (s *svc) Prefix() string {
Expand Down

0 comments on commit 046c3d5

Please sign in to comment.