aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2023-09-18 09:01:17 -0700
committerchrislu <chris.lu@gmail.com>2023-09-18 09:01:17 -0700
commitb64fc44e8dc77ea19a1c1b59663a7689fb1533a9 (patch)
tree5a7a73aa7f7c724d61e2c353f3e0b0ae5060c604
parent340aea9b34b42679868cc0028b85e6f246f0227f (diff)
parentd83107efe588a3977c42d3e43bcbfc3e35862c59 (diff)
downloadseaweedfs-b64fc44e8dc77ea19a1c1b59663a7689fb1533a9.tar.xz
seaweedfs-b64fc44e8dc77ea19a1c1b59663a7689fb1533a9.zip
Merge branch 'master' of https://github.com/seaweedfs/seaweedfs
-rw-r--r--weed/server/filer_server_handlers.go12
-rw-r--r--weed/storage/store_ec_delete.go4
2 files changed, 9 insertions, 7 deletions
diff --git a/weed/server/filer_server_handlers.go b/weed/server/filer_server_handlers.go
index 454148e66..54ddfb8b2 100644
--- a/weed/server/filer_server_handlers.go
+++ b/weed/server/filer_server_handlers.go
@@ -30,12 +30,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
- }
-
// proxy to volume servers
var fileId string
if strings.HasPrefix(r.RequestURI, "/?proxyChunkId=") {
@@ -48,6 +42,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
+ }
+
stats.FilerRequestCounter.WithLabelValues(r.Method).Inc()
defer func() {
stats.FilerRequestHistogram.WithLabelValues(r.Method).Observe(time.Since(start).Seconds())
diff --git a/weed/storage/store_ec_delete.go b/weed/storage/store_ec_delete.go
index 4b24cae79..a3e028bbb 100644
--- a/weed/storage/store_ec_delete.go
+++ b/weed/storage/store_ec_delete.go
@@ -36,7 +36,9 @@ func (s *Store) DeleteEcShardNeedle(ecVolume *erasure_coding.EcVolume, n *needle
func (s *Store) doDeleteNeedleFromAtLeastOneRemoteEcShards(ecVolume *erasure_coding.EcVolume, needleId types.NeedleId) error {
_, _, intervals, err := ecVolume.LocateEcShardNeedle(needleId, ecVolume.Version)
-
+ if err != nil {
+ return err
+ }
if len(intervals) == 0 {
return erasure_coding.NotFoundError
}