Skip to content

Commit 3bd1eee

Browse files
ShadowCurseilstam
authored andcommitted
micro-http: fix: handle new DELETE request
micro-http added brand new DELETE request and this requires us to adjust our code a bit Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
1 parent f38329d commit 3bd1eee

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/firecracker/src/api_server/parsed_request.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,10 @@ pub(crate) fn method_to_error(method: Method) -> Result<ParsedRequest, RequestEr
284284
StatusCode::BadRequest,
285285
"Empty PATCH request.".to_string(),
286286
)),
287+
Method::Delete => Err(RequestError::Generic(
288+
StatusCode::BadRequest,
289+
"Empty Delete request.".to_string(),
290+
)),
287291
}
288292
}
289293

src/vmm/src/dumbo/tcp/endpoint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ mod tests {
599599
assert_eq!(actual_response, expected_response);
600600

601601
// Test invalid HTTP methods.
602-
let invalid_methods = ["POST", "HEAD", "DELETE", "CONNECT", "OPTIONS", "TRACE"];
602+
let invalid_methods = ["POST", "HEAD", "CONNECT", "OPTIONS", "TRACE"];
603603
for method in invalid_methods.iter() {
604604
let request_bytes = format!("{} http://169.254.169.255/ HTTP/1.0\r\n\r\n", method);
605605
let mut expected_response = Response::new(Version::Http11, StatusCode::NotImplemented);

0 commit comments

Comments
 (0)