v0.42.4
This commit is contained in:
1 parent
6afaf13b89
commit
efc6eda4cd
15 files changed
+174
-41
No files matched your search
@@ -463,6 +463,19 @@ pub async fn serve(
|
||||
}
|
||||
}
|
||||
}
|
||||
// Keep application-generated errors and explicit local ErrorDocument bodies.
|
||||
// Static filesystem errors are generated by RustProxy and may be replaced
|
||||
// by Vhost/global pages in the outer HTTP response pipeline.
|
||||
if used_local_error_document
|
||||
|| matches!(
|
||||
response.extensions().get::<crate::web_server::metrics::ResponseKind>(),
|
||||
Some(crate::web_server::metrics::ResponseKind::Php)
|
||||
)
|
||||
{
|
||||
response
|
||||
.extensions_mut()
|
||||
.insert(crate::pages::OriginProvidedResponse);
|
||||
}
|
||||
if request_method == Method::HEAD {
|
||||
*response.body_mut() = Body::empty();
|
||||
}
|
||||
|
||||
@@ -119,6 +119,7 @@ async fn missing_files_and_disabled_directory_listing_return_normal_errors() {
|
||||
)
|
||||
.await;
|
||||
assert_eq!(missing.status(), StatusCode::NOT_FOUND);
|
||||
assert!(missing.extensions().get::<crate::pages::OriginProvidedResponse>().is_none());
|
||||
assert_eq!(missing.headers()[CACHE_CONTROL], "no-store");
|
||||
assert_eq!(missing.headers()[CONTENT_TYPE], "text/html; charset=utf-8");
|
||||
assert_eq!(missing.headers()["x-content-type-options"], "nosniff");
|
||||
|
||||
Reference in new issue
Block a user