mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
avoid empty extended attribute value
This commit is contained in:
parent
ce2af0082e
commit
bea26549f2
|
@ -218,7 +218,7 @@ func (fs *FilerServer) saveMetaData(ctx context.Context, r *http.Request, fileNa
|
||||||
entry.Extended = SaveAmzMetaData(r, entry.Extended, false)
|
entry.Extended = SaveAmzMetaData(r, entry.Extended, false)
|
||||||
|
|
||||||
for k, v := range r.Header {
|
for k, v := range r.Header {
|
||||||
if len(v) > 0 && (strings.HasPrefix(k, needle.PairNamePrefix) || k == "Cache-Control" || k == "Expires" || k == "Content-Disposition") {
|
if len(v) > 0 && len(v[0]) > 0 && (strings.HasPrefix(k, needle.PairNamePrefix) || k == "Cache-Control" || k == "Expires" || k == "Content-Disposition") {
|
||||||
entry.Extended[k] = []byte(v[0])
|
entry.Extended[k] = []byte(v[0])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue