mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-23 03:33:34 +08:00
Revert "Merge branch 'master' into sub"
This reverts commit4d414f54a2
, reversing changes made to4827425146
.
This commit is contained in:
@@ -30,6 +30,12 @@ func (fs *FilerServer) filerHandler(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
isReadHttpCall := r.Method == "GET" || r.Method == "HEAD"
|
||||
if !fs.maybeCheckJwtAuthorization(r, !isReadHttpCall) {
|
||||
writeJsonError(w, r, http.StatusUnauthorized, errors.New("wrong jwt"))
|
||||
return
|
||||
}
|
||||
|
||||
// proxy to volume servers
|
||||
var fileId string
|
||||
if strings.HasPrefix(r.RequestURI, "/?proxyChunkId=") {
|
||||
@@ -42,12 +48,6 @@ func (fs *FilerServer) filerHandler(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
isReadHttpCall := r.Method == "GET" || r.Method == "HEAD"
|
||||
if !fs.maybeCheckJwtAuthorization(r, !isReadHttpCall) {
|
||||
writeJsonError(w, r, http.StatusUnauthorized, errors.New("wrong jwt"))
|
||||
return
|
||||
}
|
||||
|
||||
stats.FilerRequestCounter.WithLabelValues(r.Method).Inc()
|
||||
defer func() {
|
||||
stats.FilerRequestHistogram.WithLabelValues(r.Method).Observe(time.Since(start).Seconds())
|
||||
|
Reference in New Issue
Block a user