diff options
| author | John Turner <jturner.usa@gmail.com> | 2026-03-05 00:53:59 -0500 |
|---|---|---|
| committer | John Turner <jturner.usa@gmail.com> | 2026-03-05 00:53:59 -0500 |
| commit | 34c9316e052a48fa95374936801347755f40f3b7 (patch) | |
| tree | 952a933177996e9e125f6e6571ecca8f02aa1574 /src/handler | |
| parent | 92e8d4947de614a67fed6709a59365de98705b35 (diff) | |
| download | httpd-34c9316e052a48fa95374936801347755f40f3b7.tar.gz | |
return content-length header when returning 404 in staticfile handler
Diffstat (limited to 'src/handler')
| -rw-r--r-- | src/handler/staticfile.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/handler/staticfile.rs b/src/handler/staticfile.rs index 871f414..969c4d7 100644 --- a/src/handler/staticfile.rs +++ b/src/handler/staticfile.rs @@ -43,11 +43,13 @@ impl Handle for StaticFile { } else { Ok(Response::builder() .status(Status::NotFound) + .headers([("content-length", "0")]) .body(Body::Empty)) } } Err(e) if matches!(e.kind(), io::ErrorKind::NotFound) => Ok(Response::builder() .status(Status::NotFound) + .headers([("content-length", "0")]) .body(Body::Empty)), Err(e) => Err(Error::Io(e))?, }, |
