mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-19 07:59:24 +08:00
support additional header name-value pairs
This commit is contained in:
@@ -2,14 +2,14 @@ package topology
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"net/url"
|
||||
|
||||
"github.com/chrislusf/seaweedfs/weed/glog"
|
||||
"github.com/chrislusf/seaweedfs/weed/operation"
|
||||
"github.com/chrislusf/seaweedfs/weed/security"
|
||||
@@ -55,9 +55,18 @@ func ReplicatedWrite(masterNode string, s *storage.Store,
|
||||
q.Set("cm", "true")
|
||||
}
|
||||
u.RawQuery = q.Encode()
|
||||
|
||||
pairMap := make(map[string]string)
|
||||
if needle.HasPairs() {
|
||||
err := json.Unmarshal(needle.Pairs, &pairMap)
|
||||
if err != nil {
|
||||
glog.V(0).Infoln("Unmarshal pairs error:", err)
|
||||
}
|
||||
}
|
||||
|
||||
_, err := operation.Upload(u.String(),
|
||||
string(needle.Name), bytes.NewReader(needle.Data), needle.IsGzipped(), string(needle.Mime),
|
||||
needle.Pairs, jwt)
|
||||
pairMap, jwt)
|
||||
return err
|
||||
}); err != nil {
|
||||
ret = 0
|
||||
|
Reference in New Issue
Block a user