This commit is contained in:
Mateusz Gruszczyński committed 2026-10-12 11:22:42 +02:00
1 parent 68ada6680d
commit 180a0e4877
56 files changed
+9866 -205

No files matched your search

+15 -1
View File
@@ -77,7 +77,21 @@ mod tests {
assert!(builtin_gateway_error(StatusCode::GATEWAY_TIMEOUT)
.unwrap()
.contains("504 - Gateway timeout"));
assert!(builtin_gateway_error(StatusCode::BAD_GATEWAY).is_none());
for (code, label) in [
(StatusCode::BAD_REQUEST, "400 - Bad request"),
(StatusCode::REQUEST_TIMEOUT, "408 - Request timeout"),
(StatusCode::GONE, "410 - Gone"),
(StatusCode::PAYLOAD_TOO_LARGE, "413 - Payload too large"),
(StatusCode::INTERNAL_SERVER_ERROR, "500 - Internal server error"),
(StatusCode::BAD_GATEWAY, "502 - Bad gateway"),
] {
let page = builtin_gateway_error(code).unwrap();
assert!(page.contains(label));
assert!(page.contains("background: #131615"));
}
assert!(builtin_gateway_error(StatusCode::OK).is_none());
assert!(builtin_application_page(StatusCode::OK).contains("200 - OK"));
assert!(builtin_application_page(StatusCode::CREATED).contains("background: #131615"));
}
#[test]
fn validated_bounded_pages_and_ip_detection() {