-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fs: handler tuning (cookies, cache validation)
- no-cookies for `/ip(f|n)s/` - no-cache-validation for `/ipfs/` - closes #72
- Loading branch information
Showing
3 changed files
with
10 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,14 +121,18 @@ CommonProtocolHandler.prototype = Object.freeze({ | |
if (gw.fsUris && this.scheme === FS_SCHEME) { | ||
channel.originalURI = aURI | ||
channel.loadFlags &= ~Ci.nsIChannel.LOAD_REPLACE | ||
// channel.loadFlags |= Ci.nsIChannel.LOAD_ANONYMOUS | ||
} | ||
|
||
channel.loadInfo = loadInfo | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
the8472
Contributor
|
||
// Cookies make no sense in the ipfs context | ||
// unless we have Suborigin header support. | ||
// Until https://git.io/vgAMj is resolved | ||
// we don't want to carry different gateway cookies into the page | ||
channel.loadFlags |= Ci.nsIRequest.LOAD_ANONYMOUS | ||
|
||
channel.QueryInterface(Ci.nsIWritablePropertyBag) | ||
channel.QueryInterface(Ci.nsIWritablePropertyBag2) | ||
channel.setPropertyAsAString('ipfs-uri', aURI.spec) | ||
if (isIPFS.ipfsPath(aURI.path)) { | ||
// no revalidation for /ipfs/ from cache, those are immutable | ||
channel.loadFlags |= Ci.nsIRequest.VALIDATE_NEVER | ||
} | ||
} | ||
|
||
// console.info('newChannel routed to HTTP gateway: ' + channel.URI.spec) | ||
return channel | ||
|
This file was deleted.
Oops, something went wrong.
You should keep that, I've seen cases in the debugger where loadInfo was null after http channel creation and
newChannel2
basically promises to return a channel with the provided loadinfo set.