Skip to content
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

fix: pass full response headers in net module #21552

Merged
merged 4 commits into from Jan 14, 2020
Merged

fix: pass full response headers in net module #21552

merged 4 commits into from Jan 14, 2020

Conversation

zcbenz
Copy link
Member

@zcbenz zcbenz commented Dec 17, 2019

Description of Change

Close #20631.

Use raw headers instead of filtered headers in net module. This is a regression caused by network service refactoring.

Checklist

Release Notes

Notes: Fix set-cookie header not passed in net module.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Dec 17, 2019
Copy link
Member

@nornagon nornagon left a comment

Choose a reason for hiding this comment

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

What other kinds of filtering is Chromium doing here? Is it doing any sort of normalization that we might not want to lose? Do we only need the set-cookie headers here?

shell/browser/api/atom_api_url_loader.cc Outdated Show resolved Hide resolved
shell/browser/api/atom_api_url_loader.cc Outdated Show resolved Hide resolved
lib/browser/api/net.js Outdated Show resolved Hide resolved
lib/browser/api/net.js Outdated Show resolved Hide resolved
@zcbenz
Copy link
Member Author

zcbenz commented Dec 18, 2019

What other kinds of filtering is Chromium doing here? Is it doing any sort of normalization that we might not want to lose? Do we only need the set-cookie headers here?

The raw headers are populated from net::URLRequest::response_headers(), and it is the same with 6.x, which uses net::URLRequest directly:
https://cs.chromium.org/chromium/src/services/network/loader_util.cc?type=cs&sq=package:chromium&g=0&l=102-120

Currently I'm only aware the set-cookie has been filtered because Chromium blocks third party cookies. I couldn't find a way to work around this without patching Chromium as the requests of net module are sent from browser process, and setting cookie sites does not seem to work.

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Dec 18, 2019
@zcbenz
Copy link
Member Author

zcbenz commented Jan 13, 2020

@nornagon Can you take another look at this?

lib/browser/api/net.js Outdated Show resolved Hide resolved
@nornagon nornagon merged commit ceacadb into master Jan 14, 2020
@release-clerk
Copy link

release-clerk bot commented Jan 14, 2020

Release Notes Persisted

Fix set-cookie header not passed in net module.

@nornagon nornagon deleted the fix-set-cookie branch January 14, 2020 17:36
@trop
Copy link
Contributor

trop bot commented Jan 14, 2020

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

@trop
Copy link
Contributor

trop bot commented Jan 14, 2020

I have automatically backported this PR to "7-1-x", please check out #21770

dsanders11 added a commit to dsanders11/electron that referenced this pull request Jun 9, 2021
dsanders11 added a commit to dsanders11/electron that referenced this pull request Mar 16, 2022
dsanders11 added a commit to dsanders11/electron that referenced this pull request Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Electron 7, request using net module never contains cookies in response
2 participants