Skip to content

Conversation

@alphabetaluck
Copy link
Contributor

@alphabetaluck alphabetaluck commented Jun 3, 2025

Description of Change

This PR adds the bypassCustomProtocolHandlers option to net.request(), making it consistent with net.fetch() which already has this parameter.
Currently, when using custom protocol handlers registered via protocol.handle(), there's a potential issue with circular interception when a handler needs to make network requests. While net.fetch() provides the bypassCustomProtocolHandlers parameter to prevent this, net.request() (which is used internally by net.fetch()) doesn't expose this option directly.

Close #47098

Checklist

Release Notes

Notes: Add bypassCustomProtocolHandlers option to net.request

@welcome
Copy link

welcome bot commented Jun 3, 2025

💖 Thanks for opening this pull request! 💖

Semantic PR titles

We use semantic commit messages to streamline the release process. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix.

Examples of commit messages with semantic prefixes:

  • fix: don't overwrite prevent_default if default wasn't prevented
  • feat: add app.isPackaged() method
  • docs: app.isDefaultProtocolClient is now available on Linux

Commit signing

This repo enforces commit signatures for all incoming PRs.
To sign your commits, see GitHub's documentation on Telling Git about your signing key.

PR tips

Things that will help get your PR across the finish line:

  • Follow the JavaScript, C++, and Python coding style.
  • Run npm run lint locally to catch formatting errors earlier.
  • Document any user-facing changes you've made following the documentation styleguide.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Jun 3, 2025
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Jun 10, 2025
@codebytere codebytere self-requested a review July 21, 2025 14:29
@jkleinsc jkleinsc added the semver/minor backwards-compatible functionality label Jul 21, 2025
Copy link
Member

@erickzhao erickzhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API LGTM

Copy link
Member

@samuelmaddock samuelmaddock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API LGTM

Copy link
Member

@deepak1556 deepak1556 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@udbmnm can you rebase the PR on latest main, thanks!

@codebytere codebytere added the target/38-x-y PR should also be added to the "38-x-y" branch. label Aug 1, 2025
@alphabetaluck
Copy link
Contributor Author

LGTM

@udbmnm can you rebase the PR on latest main, thanks!

Done

@github-actions github-actions bot added the target/39-x-y PR should also be added to the "39-x-y" branch. label Sep 3, 2025
@jkleinsc
Copy link
Member

@udbmnm can you sign your commits? https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits. We require signed commits.

@alphabetaluck
Copy link
Contributor Author

@udbmnm can you sign your commits? https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits. We require signed commits.

Done

@github-actions github-actions bot added the target/40-x-y PR should also be added to the "40-x-y" branch. label Oct 28, 2025
@jkleinsc jkleinsc merged commit bc86e68 into electron:main Nov 10, 2025
104 of 105 checks passed
@welcome
Copy link

welcome bot commented Nov 10, 2025

Congrats on merging your first pull request! 🎉🎉🎉

@release-clerk
Copy link

release-clerk bot commented Nov 10, 2025

Release Notes Persisted

Add bypassCustomProtocolHandlers option to net.request

@trop
Copy link
Contributor

trop bot commented Nov 10, 2025

I have automatically backported this PR to "38-x-y", please check out #48881

@trop trop bot added in-flight/38-x-y and removed target/38-x-y PR should also be added to the "38-x-y" branch. labels Nov 10, 2025
@trop
Copy link
Contributor

trop bot commented Nov 10, 2025

I have automatically backported this PR to "39-x-y", please check out #48882

@trop
Copy link
Contributor

trop bot commented Nov 10, 2025

I have automatically backported this PR to "40-x-y", please check out #48883

@trop trop bot added in-flight/39-x-y in-flight/40-x-y merged/38-x-y PR was merged to the "38-x-y" branch. merged/39-x-y PR was merged to the "39-x-y" branch. merged/40-x-y PR was merged to the "40-x-y" branch. and removed target/39-x-y PR should also be added to the "39-x-y" branch. target/40-x-y PR should also be added to the "40-x-y" branch. in-flight/38-x-y in-flight/39-x-y in-flight/40-x-y labels Nov 10, 2025
nilayarya pushed a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
…n#47331)

* feat: add bypassCustomProtocolHandlers option to net.request

* style: fix lint errors in api-protocol-spec
nilayarya added a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
…n#47331)

* feat: add bypassCustomProtocolHandlers option to net.request

* style: fix lint errors in api-protocol-spec
nilayarya added a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
…n#47331)

* feat: add bypassCustomProtocolHandlers option to net.request

* style: fix lint errors in api-protocol-spec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-review/approved ✅ merged/38-x-y PR was merged to the "38-x-y" branch. merged/39-x-y PR was merged to the "39-x-y" branch. merged/40-x-y PR was merged to the "40-x-y" branch. semver/minor backwards-compatible functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add bypassCustomProtocolHandlers option to net.requset like net.fetch

6 participants