Commit Graph

4 Commits

Author SHA1 Message Date
Takahiro Itazuri
98d85677ba feat: Allow to set custom headers in response
EC2 IMDS includes X-Aws-Ec2-Metadata-Token-Ttl-Seconds header in the
response to PUT /latest/api/token. To enable Firecracker MMDS to behave
compatibly with EC2 IMDS, allow to set custom headers in HTTP response.

Signed-off-by: Takahiro Itazuri <itazur@amazon.com>
2025-07-23 11:13:45 +01:00
Takahiro Itazuri
7e2684d779 fix: Always set Content-Length field in non-100/204 responses
The client may wait for the server to close the connection or for
timeout to occur in some cases. This commit changes it to always set
Content-Length field in non-100/204 responses regardless of whether
the body is empty. Although it doesn't cover all the patterns where
the response must not set it, users can remove it by calling
`set_content_length(None)`.

Signed-off-by: Takahiro Itazuri <itazur@amazon.com>
2024-02-21 13:18:09 +00:00
Patrick Roy
43d5a1d4b0 Clear all clippy warnings
Additionally, HttpServer::new_from_fd has been marked as unsafe,
since the correctness of the unsafe call within the function
relies on the caller upholding an invariant

Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
2022-11-22 12:15:22 +02:00
Andreea Florescu
0f741b9d2b added a basic changelog file
Signed-off-by: Andreea Florescu <fandree@amazon.com>
2020-03-24 18:22:44 +02:00