v0.29.0
This commit is contained in:
1 parent
65e082b9d1
commit
76cb4acef0
72 files changed
+6134
-4709
No files matched your search
@@ -41,6 +41,22 @@ mod tests {
|
||||
assert!(response.extensions().get::<PageServed>().is_some());
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn static_vhost_page_can_serve_html_with_503_status() {
|
||||
let page = Page {
|
||||
kind: Kind::Html,
|
||||
html: "<h1>Maintenance</h1>".into(),
|
||||
status: Some(503),
|
||||
};
|
||||
page.validate().unwrap();
|
||||
let response = page.serve(&Method::GET, StatusCode::OK);
|
||||
assert_eq!(response.status(), StatusCode::SERVICE_UNAVAILABLE);
|
||||
assert_eq!(
|
||||
response.into_body().collect().await.unwrap().to_bytes(),
|
||||
"<h1>Maintenance</h1>"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn builtin_gateway_pages_cover_edge_policy_and_gateway_errors() {
|
||||
assert!(builtin_gateway_error(StatusCode::UNAUTHORIZED)
|
||||
|
||||
Reference in new issue
Block a user