mirror of
https://github.com/servo/servo.git
synced 2025-07-25 16:20:36 +01:00
Auto merge of #22244 - georgeroman:response_statustext_default_change, r=jdm
Change Response's statusText default value from 'Ok' to an empty string <!-- Please describe your changes on the following line: --> Closes #22238 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors <!-- Either: --> - [X] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22244) <!-- Reviewable:end -->
This commit is contained in:
commit
06f453a2b8
6 changed files with 11 additions and 12 deletions
|
@ -575,6 +575,8 @@ fn scheme_fetch(
|
||||||
.headers
|
.headers
|
||||||
.typed_insert(ContentType::from(mime::TEXT_HTML_UTF_8));
|
.typed_insert(ContentType::from(mime::TEXT_HTML_UTF_8));
|
||||||
*response.body.lock().unwrap() = ResponseBody::Done(vec![]);
|
*response.body.lock().unwrap() = ResponseBody::Done(vec![]);
|
||||||
|
response.status = Some((StatusCode::OK, "OK".to_string()));
|
||||||
|
response.raw_status = Some((StatusCode::OK.as_u16(), b"OK".to_vec()));
|
||||||
response
|
response
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -588,6 +590,8 @@ fn scheme_fetch(
|
||||||
Response::new(url, ResourceFetchTiming::new(request.timing_type()));
|
Response::new(url, ResourceFetchTiming::new(request.timing_type()));
|
||||||
*response.body.lock().unwrap() = ResponseBody::Done(bytes);
|
*response.body.lock().unwrap() = ResponseBody::Done(bytes);
|
||||||
response.headers.typed_insert(ContentType::from(mime));
|
response.headers.typed_insert(ContentType::from(mime));
|
||||||
|
response.status = Some((StatusCode::OK, "OK".to_string()));
|
||||||
|
response.raw_status = Some((StatusCode::OK.as_u16(), b"OK".to_vec()));
|
||||||
response
|
response
|
||||||
},
|
},
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
|
@ -689,6 +693,9 @@ fn scheme_fetch(
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut response = Response::new(url, ResourceFetchTiming::new(request.timing_type()));
|
let mut response = Response::new(url, ResourceFetchTiming::new(request.timing_type()));
|
||||||
|
response.status = Some((StatusCode::OK, "OK".to_string()));
|
||||||
|
response.raw_status = Some((StatusCode::OK.as_u16(), b"OK".to_vec()));
|
||||||
|
|
||||||
if is_range_request {
|
if is_range_request {
|
||||||
partial_content(&mut response);
|
partial_content(&mut response);
|
||||||
}
|
}
|
||||||
|
|
|
@ -534,7 +534,7 @@ impl Metadata {
|
||||||
charset: None,
|
charset: None,
|
||||||
headers: None,
|
headers: None,
|
||||||
// https://fetch.spec.whatwg.org/#concept-response-status-message
|
// https://fetch.spec.whatwg.org/#concept-response-status-message
|
||||||
status: Some((200, b"OK".to_vec())),
|
status: Some((200, b"".to_vec())),
|
||||||
https_state: HttpsState::None,
|
https_state: HttpsState::None,
|
||||||
referrer: None,
|
referrer: None,
|
||||||
referrer_policy: None,
|
referrer_policy: None,
|
||||||
|
|
|
@ -131,8 +131,8 @@ impl Response {
|
||||||
termination_reason: None,
|
termination_reason: None,
|
||||||
url: Some(url),
|
url: Some(url),
|
||||||
url_list: vec![],
|
url_list: vec![],
|
||||||
status: Some((StatusCode::OK, "OK".to_string())),
|
status: Some((StatusCode::OK, "".to_string())),
|
||||||
raw_status: Some((200, b"OK".to_vec())),
|
raw_status: Some((200, b"".to_vec())),
|
||||||
headers: HeaderMap::new(),
|
headers: HeaderMap::new(),
|
||||||
body: Arc::new(Mutex::new(ResponseBody::Empty)),
|
body: Arc::new(Mutex::new(ResponseBody::Empty)),
|
||||||
cache_state: CacheState::None,
|
cache_state: CacheState::None,
|
||||||
|
|
|
@ -27,7 +27,7 @@ Response implements Body;
|
||||||
|
|
||||||
dictionary ResponseInit {
|
dictionary ResponseInit {
|
||||||
unsigned short status = 200;
|
unsigned short status = 200;
|
||||||
ByteString statusText = "OK";
|
ByteString statusText = "";
|
||||||
HeadersInit headers;
|
HeadersInit headers;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,3 @@
|
||||||
|
|
||||||
[Check response clone use structureClone for teed ReadableStreams (DataViewchunk)]
|
[Check response clone use structureClone for teed ReadableStreams (DataViewchunk)]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Check Response's clone with default values, without body]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,3 @@
|
||||||
type: testharness
|
type: testharness
|
||||||
[Check default value for body attribute]
|
[Check default value for body attribute]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Check default value for statusText attribute]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue