caddy-s3-proxy
caddy-s3-proxy copied to clipboard
Write (deferred) headers
trafficstars
Unlike ResponseWriter.Write, io.Copy doesn't add the deferred headers. Deferred headers are applied after the proxied response.
This (not standalong) is CORS configuration, for example, that only works with the change.
header {
Access-Control-Allow-Origin "{re.origin.0}"
Access-Control-Allow-Credentials true
Access-Control-Expose-Headers "{args[1]}"
Vary Origin
defer
}
Fixes #65 (though I suppose there may be issues with PUT and DELETE, too).
(Edit: PUT and, probably, DELETE, are affected, too — this can be merged as is, but if I fix PUT and DELETE beforehand I'll add to this PR.)