response: remove text from default statusCode

According to the specification the text of the
default statusCode should be empty.

Reference: https://fetch.spec.whatwg.org/#concept-response-status-message
This commit is contained in:
Otávio Pace 2019-10-05 12:56:16 -03:00
parent 1318ea9d02
commit a1acd29339

View file

@ -58,7 +58,7 @@ impl Response {
mime_type: DomRefCell::new("".to_string().into_bytes()), mime_type: DomRefCell::new("".to_string().into_bytes()),
body_used: Cell::new(false), body_used: Cell::new(false),
status: DomRefCell::new(Some(StatusCode::OK)), status: DomRefCell::new(Some(StatusCode::OK)),
raw_status: DomRefCell::new(Some((200, b"OK".to_vec()))), raw_status: DomRefCell::new(Some((200, b"".to_vec()))),
response_type: DomRefCell::new(DOMResponseType::Default), response_type: DomRefCell::new(DOMResponseType::Default),
url: DomRefCell::new(None), url: DomRefCell::new(None),
url_list: DomRefCell::new(vec![]), url_list: DomRefCell::new(vec![]),
@ -313,7 +313,7 @@ impl ResponseMethods for Response {
fn StatusText(&self) -> ByteString { fn StatusText(&self) -> ByteString {
match *self.raw_status.borrow() { match *self.raw_status.borrow() {
Some((_, ref st)) => ByteString::new(st.clone()), Some((_, ref st)) => ByteString::new(st.clone()),
None => ByteString::new(b"OK".to_vec()), None => ByteString::new(b"".to_vec()),
} }
} }