aboutsummaryrefslogtreecommitdiff
path: root/src/web/web_server.rs
diff options
context:
space:
mode:
authortrinity-1686a <trinity.pointard@gmail.com>2021-11-29 11:52:42 +0100
committerAlex <alex@adnab.me>2021-11-29 11:52:42 +0100
commit7f26ed55cdad4a67300447cf92bf8e4975a5c978 (patch)
tree4b19ae34f53351bc4850a6c3ab2c04dfe87f10d3 /src/web/web_server.rs
parent8811bb08e6d5eb024bacdfbb20d039c6b696e1a6 (diff)
downloadgarage-7f26ed55cdad4a67300447cf92bf8e4975a5c978.tar.gz
garage-7f26ed55cdad4a67300447cf92bf8e4975a5c978.zip
Improved handling of HTTP ranges
- correct HTTP code when range syntax is invalid (fix #140) - when multiple ranges are given, simply ignore and send whole file Co-authored-by: Trinity Pointard <trinity.pointard@gmail.com> Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/157 Reviewed-by: Alex <alex@adnab.me> Co-authored-by: trinity-1686a <trinity.pointard@gmail.com> Co-committed-by: trinity-1686a <trinity.pointard@gmail.com>
Diffstat (limited to 'src/web/web_server.rs')
-rw-r--r--src/web/web_server.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/web/web_server.rs b/src/web/web_server.rs
index e9c5039d..4a603c05 100644
--- a/src/web/web_server.rs
+++ b/src/web/web_server.rs
@@ -62,6 +62,7 @@ fn error_to_res(e: Error) -> Response<Body> {
let body: Body = Body::from(format!("{}\n", e));
let mut http_error = Response::new(body);
*http_error.status_mut() = e.http_status_code();
+ e.add_headers(http_error.headers_mut());
http_error
}