diff options
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())) } }, |