|
@ -30,12 +30,6 @@ func (fs *FilerServer) filerHandler(w http.ResponseWriter, r *http.Request) { |
|
|
return |
|
|
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
|
|
|
// proxy to volume servers
|
|
|
var fileId string |
|
|
var fileId string |
|
|
if strings.HasPrefix(r.RequestURI, "/?proxyChunkId=") { |
|
|
if strings.HasPrefix(r.RequestURI, "/?proxyChunkId=") { |
|
@ -48,6 +42,12 @@ func (fs *FilerServer) filerHandler(w http.ResponseWriter, r *http.Request) { |
|
|
return |
|
|
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() |
|
|
stats.FilerRequestCounter.WithLabelValues(r.Method).Inc() |
|
|
defer func() { |
|
|
defer func() { |
|
|
stats.FilerRequestHistogram.WithLabelValues(r.Method).Observe(time.Since(start).Seconds()) |
|
|
stats.FilerRequestHistogram.WithLabelValues(r.Method).Observe(time.Since(start).Seconds()) |
|
|