mirror of
https://github.com/versity/versitygw.git
synced 2026-02-10 04:10:07 +00:00
21 lines
441 B
Go
21 lines
441 B
Go
package utils
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/valyala/fasthttp"
|
|
)
|
|
|
|
func GetUserMetaData(headers *fasthttp.RequestHeader) (metadata map[string]string) {
|
|
metadata = make(map[string]string)
|
|
headers.VisitAll(func(key, value []byte) {
|
|
if strings.HasPrefix(string(key), "X-Amz-Meta-") {
|
|
trimmedKey := strings.TrimPrefix(string(key), "X-Amz-Meta-")
|
|
headerValue := string(value)
|
|
metadata[trimmedKey] = headerValue
|
|
}
|
|
})
|
|
|
|
return
|
|
}
|