Skip to content

Commit 4cdb67f

Browse files
authored
Merge pull request #7890 from ipfs/fix/remove-clear-site-data
fix(gw): remove use of Clear-Site-Data in subdomain router
2 parents f361232 + d61ae2b commit 4cdb67f

File tree

3 files changed

+0
-17
lines changed

3 files changed

+0
-17
lines changed

core/corehttp/hostname.go

-9
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,6 @@ func HostnameOption() ServeOption {
9797
return
9898
}
9999
if newURL != "" {
100-
// Just to be sure single Origin can't be abused in
101-
// web browsers that ignored the redirect for some
102-
// reason, Clear-Site-Data header clears browsing
103-
// data (cookies, storage etc) associated with
104-
// hostname's root Origin
105-
// Note: we can't use "*" due to bug in Chromium:
106-
// https://bugs.chromium.org/p/chromium/issues/detail?id=898503
107-
w.Header().Set("Clear-Site-Data", "\"cookies\", \"storage\"")
108-
109100
// Set "Location" header with redirect destination.
110101
// It is ignored by curl in default mode, but will
111102
// be respected by user agents that follow

docs/config.md

-1
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,6 @@ between content roots.
660660
}
661661
}
662662
```
663-
<!-- **(not implemented yet)** due to the lack of Origin isolation, cookies and storage on `Paths` will be disabled by [Clear-Site-Data](https://github.com/ipfs/in-web-browsers/issues/157) header -->
664663

665664
Default: `false`
666665

test/sharness/t0114-gateway-subdomains.sh

-7
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,6 @@ test_localhost_gateway_response_should_contain \
181181
"http://localhost:$GWAY_PORT/ipfs/$DIR_CID/" \
182182
"Location: http://$DIR_CID.ipfs.localhost:$GWAY_PORT/"
183183

184-
# Responses to the root domain of subdomain gateway hostname should Clear-Site-Data
185-
# https://github.com/ipfs/go-ipfs/issues/6975#issuecomment-597472477
186-
test_localhost_gateway_response_should_contain \
187-
"request for localhost/ipfs/{CIDv1} returns Clear-Site-Data header to purge Origin cookies and storage" \
188-
"http://localhost:$GWAY_PORT/ipfs/$CIDv1" \
189-
'Clear-Site-Data: \"cookies\", \"storage\"'
190-
191184
# We return body with HTTP 301 so existing cli scripts that use path-based
192185
# gateway do not break (curl doesn't auto-redirect without passing -L; wget
193186
# does not span across hostnames by default)

0 commit comments

Comments
 (0)