Browse Source

skip JWT if fileId is empty

related to https://github.com/chrislusf/seaweedfs/issues/1808
pull/1811/head
Chris Lu 4 years ago
parent
commit
cd866664a8
  1. 3
      weed/server/master_server_handlers.go

3
weed/server/master_server_handlers.go

@ -136,6 +136,9 @@ func (ms *MasterServer) dirAssignHandler(w http.ResponseWriter, r *http.Request)
}
func (ms *MasterServer) maybeAddJwtAuthorization(w http.ResponseWriter, fileId string, isWrite bool) {
if fileId == "" {
return
}
var encodedJwt security.EncodedJwt
if isWrite {
encodedJwt = security.GenJwt(ms.guard.SigningKey, ms.guard.ExpiresAfterSec, fileId)

Loading…
Cancel
Save