aboutsummaryrefslogtreecommitdiff
path: root/weed
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2019-02-16 12:23:35 -0800
committerChris Lu <chris.lu@gmail.com>2019-02-16 12:23:35 -0800
commit98a03b38e5798fb75fe35174da297b3528b9750e (patch)
tree50d61df4c498cb7888a7f8854cc125b1d9125cdd /weed
parent31aa60ce051b6da6617a3b733160015f2ddba693 (diff)
downloadseaweedfs-98a03b38e5798fb75fe35174da297b3528b9750e.tar.xz
seaweedfs-98a03b38e5798fb75fe35174da297b3528b9750e.zip
avoid util package depends on security package
Diffstat (limited to 'weed')
-rw-r--r--weed/command/benchmark.go2
-rw-r--r--weed/topology/store_replicate.go2
-rw-r--r--weed/util/http_util.go4
3 files changed, 3 insertions, 5 deletions
diff --git a/weed/command/benchmark.go b/weed/command/benchmark.go
index 47fdc69a0..93359b243 100644
--- a/weed/command/benchmark.go
+++ b/weed/command/benchmark.go
@@ -200,7 +200,7 @@ func writeFiles(idChan chan int, fileIdLineChan chan string, s *stat) {
if isSecure {
jwtAuthorization = operation.LookupJwt(masterClient.GetMaster(), df.fp.Fid)
}
- if e := util.Delete(fmt.Sprintf("http://%s/%s", df.fp.Server, df.fp.Fid), jwtAuthorization); e == nil {
+ if e := util.Delete(fmt.Sprintf("http://%s/%s", df.fp.Server, df.fp.Fid), string(jwtAuthorization)); e == nil {
s.completed++
} else {
s.failed++
diff --git a/weed/topology/store_replicate.go b/weed/topology/store_replicate.go
index c73fb706a..3967bb3e3 100644
--- a/weed/topology/store_replicate.go
+++ b/weed/topology/store_replicate.go
@@ -102,7 +102,7 @@ func ReplicatedDelete(masterNode string, store *storage.Store,
if needToReplicate { //send to other replica locations
if r.FormValue("type") != "replicate" {
if err = distributedOperation(masterNode, store, volumeId, func(location operation.Location) error {
- return util.Delete("http://"+location.Url+r.URL.Path+"?type=replicate", jwt)
+ return util.Delete("http://"+location.Url+r.URL.Path+"?type=replicate", string(jwt))
}); err != nil {
ret = 0
}
diff --git a/weed/util/http_util.go b/weed/util/http_util.go
index 21e0a678d..a465a7b7f 100644
--- a/weed/util/http_util.go
+++ b/weed/util/http_util.go
@@ -12,8 +12,6 @@ import (
"net/url"
"strings"
"time"
-
- "github.com/chrislusf/seaweedfs/weed/security"
)
var (
@@ -97,7 +95,7 @@ func Head(url string) (http.Header, error) {
return r.Header, nil
}
-func Delete(url string, jwt security.EncodedJwt) error {
+func Delete(url string, jwt string) error {
req, err := http.NewRequest("DELETE", url, nil)
if jwt != "" {
req.Header.Set("Authorization", "BEARER "+string(jwt))