зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1453612 - Response.redirect() should have empty string statusText. r=baku
This commit is contained in:
Родитель
eca2cd1106
Коммит
8feb556198
|
@ -140,6 +140,7 @@ Response::Redirect(const GlobalObject& aGlobal, const nsAString& aUrl,
|
||||||
Optional<Nullable<fetch::ResponseBodyInit>> body;
|
Optional<Nullable<fetch::ResponseBodyInit>> body;
|
||||||
ResponseInit init;
|
ResponseInit init;
|
||||||
init.mStatus = aStatus;
|
init.mStatus = aStatus;
|
||||||
|
init.mStatusText.AssignASCII("");
|
||||||
RefPtr<Response> r = Response::Constructor(aGlobal, body, init, aRv);
|
RefPtr<Response> r = Response::Constructor(aGlobal, body, init, aRv);
|
||||||
if (NS_WARN_IF(aRv.Failed())) {
|
if (NS_WARN_IF(aRv.Failed())) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
|
@ -105,6 +105,7 @@ function testError() {
|
||||||
function testRedirect() {
|
function testRedirect() {
|
||||||
var res = Response.redirect("./redirect.response");
|
var res = Response.redirect("./redirect.response");
|
||||||
is(res.status, 302, "Default redirect has status code 302");
|
is(res.status, 302, "Default redirect has status code 302");
|
||||||
|
is(res.statusText, "", "Default redirect has status text empty");
|
||||||
var h = res.headers.get("location");
|
var h = res.headers.get("location");
|
||||||
ok(h === (new URL("./redirect.response", self.location.href)).href, "Location header should be correct absolute URL");
|
ok(h === (new URL("./redirect.response", self.location.href)).href, "Location header should be correct absolute URL");
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -1,22 +1,3 @@
|
||||||
[response-static-redirect.html]
|
[response-static-redirect.html]
|
||||||
[Check error returned when giving invalid url to redirect()]
|
[Check error returned when giving invalid url to redirect()]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Check default redirect response]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Check response returned by static method redirect(), status = 301]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Check response returned by static method redirect(), status = 302]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Check response returned by static method redirect(), status = 303]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Check response returned by static method redirect(), status = 307]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Check response returned by static method redirect(), status = 308]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче