aboutsummaryrefslogtreecommitdiff
path: root/weed/server
diff options
context:
space:
mode:
authorzhangsong <songz.qqmail@qq.com>2021-06-30 18:33:18 +0800
committerzhangsong <songz.qqmail@qq.com>2021-06-30 18:33:18 +0800
commit20d33ae0252d73a1baa11758cea737227e73db56 (patch)
tree27e7de62719f13b8e943ae2280d24c2be2f83f8a /weed/server
parent7566782c2e172408bbbfd32bb5c3b505bfd8d5e1 (diff)
downloadseaweedfs-20d33ae0252d73a1baa11758cea737227e73db56.tar.xz
seaweedfs-20d33ae0252d73a1baa11758cea737227e73db56.zip
add proxy mode to read non-local volumes
Diffstat (limited to 'weed/server')
-rw-r--r--weed/server/volume_server_handlers.go2
-rw-r--r--weed/server/volume_server_handlers_read.go2
2 files changed, 1 insertions, 3 deletions
diff --git a/weed/server/volume_server_handlers.go b/weed/server/volume_server_handlers.go
index d35146d56..8ac3c0d90 100644
--- a/weed/server/volume_server_handlers.go
+++ b/weed/server/volume_server_handlers.go
@@ -1,7 +1,6 @@
package weed_server
import (
- "fmt"
"net/http"
"strconv"
"strings"
@@ -82,7 +81,6 @@ func getContentLength(r *http.Request) int64 {
}
func (vs *VolumeServer) publicReadOnlyHandler(w http.ResponseWriter, r *http.Request) {
- fmt.Printf("publicReadOnlyHandler in.")
w.Header().Set("Server", "SeaweedFS Volume "+util.VERSION)
if r.Header.Get("Origin") != "" {
w.Header().Set("Access-Control-Allow-Origin", "*")
diff --git a/weed/server/volume_server_handlers_read.go b/weed/server/volume_server_handlers_read.go
index 2100eb620..13644ab01 100644
--- a/weed/server/volume_server_handlers_read.go
+++ b/weed/server/volume_server_handlers_read.go
@@ -70,7 +70,7 @@ func (vs *VolumeServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request)
w.WriteHeader(http.StatusNotFound)
return
}
- if vs.ReadMode == "remote" {
+ if vs.ReadMode == "proxy" {
// proxy client request to target server
u, _ := url.Parse(util.NormalizeUrl(lookupResult.Locations[0].Url))
r.URL.Host = u.Host