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(network): don't disable cache for auth challenge #6962

Merged
merged 6 commits into from Mar 15, 2021
Merged

fix(network): don't disable cache for auth challenge #6962

merged 6 commits into from Mar 15, 2021

Conversation

Androbin
Copy link
Contributor

@Androbin Androbin commented Mar 6, 2021

#729 introduced _updateProtocolRequestInterception
Objective: Call Network.setRequestInterceptionEnabled for auth challenge or if requested by user

#1154 introduced Network.setCacheDisabled
Objective: Ensure custom user response handling is always called

#4260 introduced _updateProtocolCacheDisabled
Objective: Call Network.setCacheDisabled if requested by user

The cache and request interception work on the network level, while we want the custom user response handling to work independent of the network, which is why we're currently forced to disable the cache in some cases.

As long as there is no custom user response handling, it should be unnecessary to disable the cache for the auth challenge, since it only needs to be called in case of an actual network request anyway.

Related issue: #2905

@google-cla google-cla bot added the cla: yes label Mar 6, 2021
@Androbin Androbin changed the title Don't disable cache with authenticated proxy Don't disable cache for auth challenge Mar 6, 2021
@mathiasbynens mathiasbynens requested a review from OrKoN March 9, 2021 08:00
@mathiasbynens
Copy link
Member

@OrKoN could you PTAL?

Copy link
Collaborator

@OrKoN OrKoN left a comment

Choose a reason for hiding this comment

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

The change LGTM. It seems there are no current tests for this logic. Would it be possible to add the tests so that we capture the right expectations and no one changes the logic back if it does not work for some use cases?

@Androbin
Copy link
Contributor Author

@OrKoN I added a unit test covering this logic.

Copy link
Collaborator

@OrKoN OrKoN left a comment

Choose a reason for hiding this comment

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

Thanks!

@OrKoN OrKoN changed the title Don't disable cache for auth challenge fix(network): don't disable cache for auth challenge Mar 10, 2021
@OrKoN OrKoN enabled auto-merge (squash) March 15, 2021 06:55
@OrKoN OrKoN merged commit 1c2479a into puppeteer:main Mar 15, 2021
@Androbin Androbin deleted the proxy-cache branch March 15, 2021 18:18
@Androbin
Copy link
Contributor Author

Androbin commented May 7, 2021

Related: #6996, #7038, and #7060

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants