Skip to content

Commit 912a972

Browse files
committed
gateway: remove Suborigins as it conflicts the spec
The Suborigins spec was changed and we have to adjust, the spec is still unstable and it might change in future. Currently the only browser supporting it (Chrome) errors out on it as it doesn't confront spec it uses. See ipfs/specs#131 License: MIT Signed-off-by: Jakub Sztandera <[email protected]>
1 parent 548490f commit 912a972

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)