-
Notifications
You must be signed in to change notification settings - Fork 16.3k
fix: webContents.downloadurl("")
did not support referer header
#47625
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
Conversation
💖 Thanks for opening this pull request! 💖 Semantic PR titlesWe 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:
Commit signingThis repo enforces commit signatures for all incoming PRs. PR tipsThings that will help get your PR across the finish line:
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. |
b7a5e0e
to
2152523
Compare
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.
Thanks! Could you rebase this when you have a moment?
2152523
to
501f1ec
Compare
Thanks! I've just rebased the branch. |
Hi @codebytere , thank you for approving this PR. I noticed that the merge was blocked by some failing CI checks. I've looked into the logs for the jobs, and the failures appear to be in areas unrelated to my code changes. It seems like they might be flaky. Would it be possible to get a re-run of the CI, or could you take a look when you have a chance? |
@xufuhang could you please verify your commit? It's a project policy. |
501f1ec
to
a3c072a
Compare
Hi @codebytere , I've just signed the commit, thank you for the guidance! It seems the workflows are now awaiting your approval to run. Could you please take a look when you have a moment? |
@xufuhang the mac failures will be solved with rebase |
Signed-off-by: xufuhang <576484918@qq.com>
30ca923
to
7098b2c
Compare
Hi @codebytere, I've just rebased the branch. It seems the workflows are now awaiting your approval to run. Could you please take a look when you have a moment? |
Hi @codebytere , thank you for approving. I've looked into the logs for the jobs, and the failures appear to be in areas unrelated to my code changes. Could you take a look again when you have a chance? |
Congrats on merging your first pull request! 🎉🎉🎉 |
Release Notes Persisted
|
I have automatically backported this PR to "37-x-y", please check out #47865 |
I have automatically backported this PR to "36-x-y", please check out #47866 |
I have automatically backported this PR to "38-x-y", please check out #47867 |
Description of Change
This PR fixes an issue where the
Referer
HTTP header was not being correctly applied when using thewebContents.downloadurl("")
API.The previous implementation added all headers, including
Referer
, through the genericadd_request_header
method. However,Referer
is a special header that cannot be set via the genericadd_request_header
method. Instead, the download system requires the referrer to be set specifically viadownload_params->set_referrer()
.This change adds logic to specifically detect the
Referer
header (case-insensitively) from the options and sets it using the correct method, ensuring it is properly handled during the download request. Other headers continue to be processed as before.Before this PR:
After this PR:
Checklist
npm test
passesRelease Notes
Notes: Fixed a bug where the
Referer
header was not being set correctly when usingwebContents.downloadurl("")
.