mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
fix: add source browsing context to Request
and HTTP credentials prompt (#34808)
* fix: add source browsing ctx id to request when initiate navigation Signed-off-by: Jason Tsai <git@pews.dev> * chore: clippy Signed-off-by: Jason Tsai <git@pews.dev> * Update components/net/http_loader.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Jason Tsai <git@pews.dev> * chore: apply suggestions Co-authored-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Jason Tsai <git@pews.dev> * chore: fix naming Signed-off-by: Jason Tsai <git@pews.dev> * refactor: set request browsing ctx id on pre page load Signed-off-by: Jason Tsai <git@pews.dev> --------- Signed-off-by: Jason Tsai <git@pews.dev> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
b87a0db497
commit
8b115c246c
4 changed files with 28 additions and 7 deletions
|
@ -123,6 +123,7 @@ fn request_init_from_request(request: NetTraitsRequest) -> RequestBuilder {
|
|||
referrer: request.referrer.clone(),
|
||||
referrer_policy: request.referrer_policy,
|
||||
pipeline_id: request.pipeline_id,
|
||||
target_browsing_context_id: request.target_browsing_context_id,
|
||||
redirect_mode: request.redirect_mode,
|
||||
integrity_metadata: request.integrity_metadata.clone(),
|
||||
url_list: vec![],
|
||||
|
|
|
@ -3505,6 +3505,7 @@ impl ScriptThread {
|
|||
/// argument until a notification is received that the fetch is complete.
|
||||
fn pre_page_load(&self, mut incomplete: InProgressLoad, load_data: LoadData) {
|
||||
let id = incomplete.pipeline_id;
|
||||
let top_level_browsing_context_id = incomplete.top_level_browsing_context_id;
|
||||
let req_init = RequestBuilder::new(load_data.url.clone(), load_data.referrer)
|
||||
.method(load_data.method)
|
||||
.destination(Destination::Document)
|
||||
|
@ -3512,6 +3513,7 @@ impl ScriptThread {
|
|||
.credentials_mode(CredentialsMode::Include)
|
||||
.use_url_credentials(true)
|
||||
.pipeline_id(Some(id))
|
||||
.target_browsing_context_id(Some(top_level_browsing_context_id))
|
||||
.referrer_policy(load_data.referrer_policy)
|
||||
.headers(load_data.headers)
|
||||
.body(load_data.data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue