mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Introduce GlobalScope::get_url
This commit is contained in:
parent
092504b4e3
commit
f38159b7d3
10 changed files with 39 additions and 39 deletions
|
@ -149,9 +149,10 @@ impl Response {
|
|||
|
||||
// https://fetch.spec.whatwg.org/#dom-response-redirect
|
||||
pub fn Redirect(global: GlobalRef, url: USVString, status: u16) -> Fallible<Root<Response>> {
|
||||
let global_scope = global.as_global_scope();
|
||||
// Step 1
|
||||
// TODO: `entry settings object` is not implemented in Servo yet.
|
||||
let base_url = global.get_url();
|
||||
let base_url = global_scope.get_url();
|
||||
let parsed_url = base_url.join(&url.0);
|
||||
|
||||
// Step 2
|
||||
|
@ -167,7 +168,7 @@ impl Response {
|
|||
|
||||
// Step 4
|
||||
// see Step 4 continued
|
||||
let r = Response::new(global.as_global_scope());
|
||||
let r = Response::new(global_scope);
|
||||
|
||||
// Step 5
|
||||
*r.status.borrow_mut() = Some(StatusCode::from_u16(status));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue