Skip to content

Commit

Permalink
Set empty role ids array
Browse files Browse the repository at this point in the history
  • Loading branch information
kulmann committed Dec 14, 2020
1 parent 97af5df commit 657a6b9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ocis-pkg/middleware/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package middleware

import (
"context"
"encoding/json"
"net/http"

"github.com/cs3org/reva/pkg/token/manager/jwt"
Expand Down Expand Up @@ -46,7 +47,8 @@ func ExtractAccountUUID(opts ...account.Option) func(http.Handler) http.Handler
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
token := r.Header.Get("x-access-token")
if len(token) == 0 {
ctx := metadata.Set(r.Context(), RoleIDs, "")
roleIDsJSON, _ := json.Marshal([]string{})
ctx := metadata.Set(r.Context(), RoleIDs, string(roleIDsJSON))
next.ServeHTTP(w, r.WithContext(ctx))
return
}
Expand Down

0 comments on commit 657a6b9

Please sign in to comment.