mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Do not return an error for non-GET data: requests (fixes #13293)
This commit is contained in:
parent
e0731215c0
commit
c0f9fb8f55
2 changed files with 28 additions and 12 deletions
|
@ -395,18 +395,14 @@ fn basic_fetch(request: &mut Request,
|
|||
},
|
||||
|
||||
"data" => {
|
||||
if request.method == Method::Get {
|
||||
match decode(&url) {
|
||||
Ok((mime, bytes)) => {
|
||||
let mut response = Response::new(url);
|
||||
*response.body.lock().unwrap() = ResponseBody::Done(bytes);
|
||||
response.headers.set(ContentType(mime));
|
||||
response
|
||||
},
|
||||
Err(_) => Response::network_error(NetworkError::Internal("Decoding data URL failed".into()))
|
||||
}
|
||||
} else {
|
||||
Response::network_error(NetworkError::Internal("Unexpected method for data".into()))
|
||||
match decode(&url) {
|
||||
Ok((mime, bytes)) => {
|
||||
let mut response = Response::new(url);
|
||||
*response.body.lock().unwrap() = ResponseBody::Done(bytes);
|
||||
response.headers.set(ContentType(mime));
|
||||
response
|
||||
},
|
||||
Err(_) => Response::network_error(NetworkError::Internal("Decoding data URL failed".into()))
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -3,3 +3,23 @@
|
|||
[XHR method GET with charset text/html;charset=UTF-8]
|
||||
expected: FAIL
|
||||
|
||||
[XHR method POST with charset text/plain]
|
||||
bug: https://github.com/w3c/web-platform-tests/issues/3738
|
||||
expected: FAIL
|
||||
|
||||
[XHR method PUT with charset text/plain]
|
||||
bug: https://github.com/w3c/web-platform-tests/issues/3738
|
||||
expected: FAIL
|
||||
|
||||
[XHR method DELETE with charset text/plain]
|
||||
bug: https://github.com/w3c/web-platform-tests/issues/3738
|
||||
expected: FAIL
|
||||
|
||||
[XHR method HEAD with charset text/plain]
|
||||
bug: https://github.com/w3c/web-platform-tests/issues/3738
|
||||
expected: FAIL
|
||||
|
||||
[XHR method UNICORN with charset text/plain]
|
||||
bug: https://github.com/w3c/web-platform-tests/issues/3738
|
||||
expected: FAIL
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue