Commit Graph

16 Commits

Author SHA1 Message Date
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
George Pisaltu
0a58eb1ece added support for Deprecation header
This commit adds support for the `Deprecation` HTTP header based on
https://tools.ietf.org/id/draft-dalal-deprecation-header-03.html .
Users can set this header in a `Response` to send a
"Deprecation: true" header field back to the requester, signaling
that the resource accessed has been deprecated.

Signed-off-by: George Pisaltu <gpl@amazon.com>
2021-10-19 20:37:52 +03:00
AlexandruCihodaru
ba4e5a0917 Added payload too large response
Signed-off-by: AlexandruCihodaru <cihodar@amazon.com>
Suggested-by: George Pisaltu <gpl@amazon.com>
2021-09-03 13:56:22 +03:00
Luminita Voicu
c1a38b507c response: add Unauthorized status code
Signed-off-by: Luminita Voicu <lumivo@amazon.com>
2021-08-09 17:18:31 +03:00
Luminita Voicu
a5fdf928eb response: minor comment fixes
Signed-off-by: Luminita Voicu <lumivo@amazon.com>
2021-07-09 11:32:22 +03:00
YUAN LYU
49240ce1d5 Add unit tests to raise coverage score
Signed-off-by: YUAN LYU <lyuyuan92@gmail.com>
2021-04-15 11:21:32 +03:00
Alexandru Cihodaru
683b85d07e Added support for Accept-Encoding
Signed-off-by: Alexandru Cihodaru <cihodar@amazon.com>
Signed-off-by: YUAN LYU <lyuyuan92@gmail.com>
2021-04-15 11:21:32 +03:00
Damien Stanton
a7f035b8c5 micro_http: switch to rust edition 2018
Signed-off-by: Damien Stanton <damien.stanton@gmail.com>
Signed-off-by: YUAN LYU <lyuyuan92@gmail.com>
2021-04-15 11:21:32 +03:00
Ioana Chirca
17ead39d82 micro_http: check arithmetic operations
Signed-off-by: Ioana Chirca <chioana@amazon.com>
Signed-off-by: YUAN LYU <lyuyuan92@gmail.com>
2021-04-15 11:21:32 +03:00
moricho
9830b66a09 dumbo: remove dumbo's dependency on mmds
This moves dumbo::ns to mmds crate and
implements response retrieval callback passed to dumbo's tcp::handler

Signed-off-by: moricho <ikeda.morito@gmail.com>
Signed-off-by: YUAN LYU <lyuyuan92@gmail.com>
2021-04-15 11:21:32 +03:00
Iulian Barbu
d37f9671af micro-http: added MethodNotAllow status code
When server returns `Method Not Allow` responses,
it can attach to the response a HTTP `Allow` header.
Added support for HTTP response `Allow` header as
well.

Signed-off-by: Iulian Barbu <iul@amazon.com>
Signed-off-by: YUAN LYU <lyuyuan92@gmail.com>
2021-04-15 11:21:32 +03:00
karthik nedunchezhiyan
569230220f micro_http: some doc and code corrections
Signed-off-by: karthik nedunchezhiyan <karthik1705.n@gmail.com>
Signed-off-by: YUAN LYU <lyuyuan92@gmail.com>
2021-04-15 11:21:32 +03:00
Changwei Ge
59ab64440a Add http status code 503
When we are not capable to provide a certain kind of service, but should be
after some delay. Http server is better to reply status code 503. It is more
suggestive per as to http spec.

```
The server is currently unable to handle the request due to a temporary
overload or scheduled maintenance, which will likely be alleviated after some delay.
```

Signed-off-by: Changwei Ge <chge@linux.alibaba.com>
2020-11-03 08:38:02 +02:00
Liu Jiang
aefdd1be46 Refine documentation according to latest code
Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2020-03-30 13:52:34 +03:00
Liu Jiang
fbb4d5392a Refine code for rust edition 2018
Refine code to support rust edition 2018, no functional changes.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2020-03-30 13:52:34 +03:00
Andreea Florescu
6708271862 initial commit
Pulled the code from firecracker-microvm/src/micro-http.

Signed-off-by: George Pisaltu <gpl@amazon.com>
Signed-off-by: Andreea Florescu <fandree@amazon.com>
2020-01-27 12:28:50 +02:00