diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2017-04-08 21:47:55 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2017-04-08 21:47:55 +0200 |
commit | c0f9fb8f552d70494fbbad9f1363c9c8ee91334b (patch) | |
tree | b63ab4be234d6934c43bea71d09f711a033c7ef4 /components/net/fetch/methods.rs | |
parent | e0731215c0e712d792ea64a709c5178cb2cab165 (diff) | |
download | servo-c0f9fb8f552d70494fbbad9f1363c9c8ee91334b.tar.gz servo-c0f9fb8f552d70494fbbad9f1363c9c8ee91334b.zip |
Do not return an error for non-GET data: requests (fixes #13293)
Diffstat (limited to 'components/net/fetch/methods.rs')
-rw-r--r-- | components/net/fetch/methods.rs | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/components/net/fetch/methods.rs b/components/net/fetch/methods.rs index eb740a1cb53..a073056ee56 100644 --- a/components/net/fetch/methods.rs +++ b/components/net/fetch/methods.rs @@ -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())) } }, |