fix: webContents.downloadURL() did not support referer header#47625
fix: webContents.downloadURL() did not support referer header#47625codebytere merged 1 commit intoelectron:mainfrom
webContents.downloadURL() did not support referer header#47625Conversation
|
💖 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
codebytere
left a comment
There was a problem hiding this comment.
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 |
…tron#47625) Signed-off-by: xufuhang <576484918@qq.com>
Description of Change
This PR fixes an issue where the
RefererHTTP header was not being correctly applied when using thewebContents.downloadURL()API.The previous implementation added all headers, including
Referer, through the genericadd_request_headermethod. However,Refereris a special header that cannot be set via the genericadd_request_headermethod. Instead, the download system requires the referrer to be set specifically viadownload_params->set_referrer().This change adds logic to specifically detect the
Refererheader (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 testpassesRelease Notes
Notes: Fixed a bug where the
Refererheader was not being set correctly when usingwebContents.downloadURL().