1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-29 01:12:24 +08:00

Merge pull request #4073 from icidasset/master

Expose Content-Range header
This commit is contained in:
Jeromy Johnson
2017-08-05 12:24:55 -07:00
committed by GitHub

View File

@ -208,9 +208,17 @@ func (i *gatewayHandler) getOrHeadHandler(ctx context.Context, w http.ResponseWr
w.Header().Set("Etag", etag) w.Header().Set("Etag", etag)
// set 'allowed' headers // set 'allowed' headers
w.Header().Set("Access-Control-Allow-Headers", "X-Stream-Output, X-Chunked-Output") // & expose those headers
// expose those headers var allowedHeadersArr = []string{
w.Header().Set("Access-Control-Expose-Headers", "X-Stream-Output, X-Chunked-Output") "Content-Range",
"X-Chunked-Output",
"X-Stream-Output",
}
var allowedHeaders = strings.Join(allowedHeadersArr, ", ")
w.Header().Set("Access-Control-Allow-Headers", allowedHeaders)
w.Header().Set("Access-Control-Expose-Headers", allowedHeaders)
// Suborigin header, sandboxes apps from each other in the browser (even // Suborigin header, sandboxes apps from each other in the browser (even
// though they are served from the same gateway domain). // though they are served from the same gateway domain).