-
Notifications
You must be signed in to change notification settings - Fork 16.2k
feat: add protocol.handle #36674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add protocol.handle #36674
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API LGTM
Have been testing out various URL canonicalization things and discovered a few quirks that I think merit closer attention.
I'm not really sure what to do about all this. It seems pretty confusing, and I don't even think I've covered all the quirks of standard vs non-standard schemes. Perhaps it all just needs to be well documented? Thoughts? |
i noticed a lot of what i noted above is already documented at https://www.electronjs.org/docs/latest/api/protocol#protocolregisterschemesasprivilegedcustomschemes, so maybe this isn't as big of an issue as i thought. |
Release Notes Persisted
|
This comment was marked as resolved.
This comment was marked as resolved.
I'm curious, I have a custom protocol implemented that requires streaming the response. I read and write to a unix socket, and the response is so large it cannot be buffered. How am I suppose to migrate to handle given that it expects a Response object. I don't see how that would work with a streamed response? |
Description of Change
This adds a new method to the
protocol
module,protocol.handle
, which replaces the existingregister{Buffer,String,Stream,File,Http}Protocol
andintercept{Buffer,String,Stream,File,Http}Protocol
methods.See electron/governance#368 for motivation and further details, though this PR has progressed the design slightly.
Checklist
npm test
passesRelease Notes
Notes: Added
protocol.handle
, replacing and deprecatingprotocol.{register,intercept}{String,Buffer,Stream,Http,File}Protocol
.