mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 10:59:13 +00:00
fix(op_crates/fetch): redirect: "manual"
fetch should return type: "default"
response (#8353)
This commit is contained in:
parent
276f529755
commit
501a31fcf3
2 changed files with 8 additions and 20 deletions
|
@ -693,18 +693,10 @@ unitTest(
|
|||
const response = await fetch("http://localhost:4546/", {
|
||||
redirect: "manual",
|
||||
}); // will redirect to http://localhost:4545/
|
||||
assertEquals(response.status, 0);
|
||||
assertEquals(response.statusText, "");
|
||||
assertEquals(response.url, "");
|
||||
assertEquals(response.type, "opaqueredirect");
|
||||
try {
|
||||
await response.text();
|
||||
fail(
|
||||
"Reponse.text() didn't throw on a filtered response without a body (type opaqueredirect)",
|
||||
);
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
assertEquals(response.status, 301);
|
||||
assertEquals(response.url, "http://localhost:4546/");
|
||||
assertEquals(response.type, "default");
|
||||
assertEquals(response.headers.get("Location"), "http://localhost:4545/");
|
||||
},
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue