Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

Add optional http redirect for filer GET requests.

chrislusfe431d4121e8d
diff --git a/go/weed/weed_server/filer_server_handlers.go b/go/weed/weed_server/filer_server_handlers.go
index 9d8481ac92..6f22912a79 100644
--- a/go/weed/weed_server/filer_server_handlers.go
+++ b/go/weed/weed_server/filer_server_handlers.go
@@ -83,7 +83,8 @@ func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request,
urlLocation := lookup.Locations[rand.Intn(len(lookup.Locations))].PublicUrl
urlString := "http://" + urlLocation + "/" + fileId
if fs.redirectOnRead {
-
+ http.Redirect(w, r, urlString, http.StatusFound)
+ return
}
u, _ := url.Parse(urlString)
request := &http.Request{