mirror of
https://github.com/versity/versitygw.git
synced 2026-08-18 21:26:27 +00:00
feat: add response header overrides for GetObject
GetObject allows overriding response headers with the following paramters: response-cache-control response-content-disposition response-content-encoding response-content-language response-content-type response-expires This is only valid for signed (and pre-singed) requests. An error is returned for anonymous requests if these are set. More info on the GetObject overrides can be found in the GetObject API reference. This also clarifies the naming of the AccessOptions IsPublicBucket to IsPublicRequest to indicate this is a public access request and not just accessing a bucket that allows public access. Fixes #1501
This commit is contained in:
@@ -779,3 +779,20 @@ func ValidateCopySource(copysource string) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetQueryParam returns a pointer to the query parameter value if it exists
|
||||
func GetQueryParam(ctx *fiber.Ctx, key string) *string {
|
||||
value := ctx.Query(key)
|
||||
if value == "" {
|
||||
return nil
|
||||
}
|
||||
return &value
|
||||
}
|
||||
|
||||
// ApplyOverride returns the override value if it exists and status is 200, otherwise returns original
|
||||
func ApplyOverride(original, override *string) *string {
|
||||
if override != nil {
|
||||
return override
|
||||
}
|
||||
return original
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user