Skip to content

Commit

Permalink
Merge pull request #3519 from ipfs/fix/gateways/suborigins-off
Browse files Browse the repository at this point in the history
gateway: disable Suborigins as it conflicts the spec
  • Loading branch information
whyrusleeping authored Dec 21, 2016
2 parents e286462 + 912a972 commit 17699b2
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions core/corehttp/gateway_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,19 +199,6 @@ func (i *gatewayHandler) getOrHeadHandler(ctx context.Context, w http.ResponseWr
// expose those headers
w.Header().Set("Access-Control-Expose-Headers", "X-Stream-Output, X-Chunked-Output")

// Suborigin header, sandboxes apps from each other in the browser (even
// though they are served from the same gateway domain).
//
// Omited if the path was treated by IPNSHostnameOption(), for example
// a request for http://example.net/ would be changed to /ipns/example.net/,
// which would turn into an incorrect Suborigin: example.net header.
//
// NOTE: This is not yet widely supported by browsers.
if !ipnsHostname {
pathRoot := strings.SplitN(urlPath, "/", 4)[2]
w.Header().Set("Suborigin", pathRoot)
}

// set these headers _after_ the error, for we may just not have it
// and dont want the client to cache a 500 response...
// and only if it's /ipfs!
Expand Down

0 comments on commit 17699b2

Please sign in to comment.