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: crash when doing redirect navigation with webRequest listener #21838

Merged
merged 2 commits into from Jan 22, 2020

Conversation

zcbenz
Copy link
Member

@zcbenz zcbenz commented Jan 20, 2020

Description of Change

Close #21597.

This PR contains 2 fixes:

  1. Fix a DCHECK due to lack of navigation_ui_data.
  2. Fix crash due to current_response_ being moved instead of cloned. This is caused by Chromium changing the behavior of their API without changing the signature.

Checklist

Release Notes

Notes: Fix crash when doing redirect navigation with webRequest listener.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Jan 20, 2020
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

@@ -538,8 +541,7 @@ void ProxyingURLLoaderFactory::InProgressRequest::ContinueToBeforeRedirect(

factory_->web_request_api()->OnBeforeRedirect(&info_.value(), request_,
redirect_info.new_url);
target_client_->OnReceiveRedirect(redirect_info,
std::move(current_response_));
target_client_->OnReceiveRedirect(redirect_info, current_response_.Clone());
Copy link
Member

Choose a reason for hiding this comment

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

Should we also clone the response in target_client_->OnReceiveResponse ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah it should also be changed, thanks for noticing this.

@trop
Copy link
Contributor

trop bot commented Jan 21, 2020

@zcbenz has manually backported this PR to "8-x-y", please check out #21841

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Jan 21, 2020
@zcbenz zcbenz merged commit fbc2f83 into master Jan 22, 2020
@zcbenz zcbenz deleted the web-request-http-request-crash branch January 22, 2020 01:31
@release-clerk
Copy link

release-clerk bot commented Jan 22, 2020

Release Notes Persisted

Fix crash when doing redirect navigation with webRequest listener.

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.

Crash when going to http://google.com with any webRequest listener
2 participants