@cryptotaxi247 / kubo / commits / 912a9720b

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 https://github.com/ipfs/specs/issues/131 License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>

Jakub Sztandera committed Dec 19, 2016 at 13:59 UTC 912a9720bdbe1ed0071383be371b902a6f79c780
1 file changed -13
core/corehttp/gateway_handler.go
-13
@@ -199,19 +199,6 @@ func (i *gatewayHandler) getOrHeadHandler(ctx context.Context, w http.ResponseWr
199 // expose those headers
200 w.Header().Set("Access-Control-Expose-Headers", "X-Stream-Output, X-Chunked-Output")
201
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 -
202 // set these headers _after_ the error, for we may just not have it
203 // and dont want the client to cache a 500 response...
204 // and only if it's /ipfs!