Skip to content

Commit 17699b2

Browse files
Merge pull request #3519 from ipfs/fix/gateways/suborigins-off
gateway: disable Suborigins as it conflicts the spec
2 parents e286462 + 912a972 commit 17699b2

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

core/corehttp/gateway_handler.go

-13
Original file line numberDiff line numberDiff line change
@@ -199,19 +199,6 @@ func (i *gatewayHandler) getOrHeadHandler(ctx context.Context, w http.ResponseWr
199199
// expose those headers
200200
w.Header().Set("Access-Control-Expose-Headers", "X-Stream-Output, X-Chunked-Output")
201201

202-
// Suborigin header, sandboxes apps from each other in the browser (even
203-
// though they are served from the same gateway domain).
204-
//
205-
// Omited if the path was treated by IPNSHostnameOption(), for example
206-
// a request for http://example.net/ would be changed to /ipns/example.net/,
207-
// which would turn into an incorrect Suborigin: example.net header.
208-
//
209-
// NOTE: This is not yet widely supported by browsers.
210-
if !ipnsHostname {
211-
pathRoot := strings.SplitN(urlPath, "/", 4)[2]
212-
w.Header().Set("Suborigin", pathRoot)
213-
}
214-
215202
// set these headers _after_ the error, for we may just not have it
216203
// and dont want the client to cache a 500 response...
217204
// and only if it's /ipfs!

0 commit comments

Comments
 (0)