mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
perf(core): look up the authority only for an HTTP/1.0 request in the missing Host check (#8443)
This commit is contained in:
1 parent
e9f842765d
commit
f5e08d5e9c
2 files changed
+20
-2
No files matched your search
@@ -64,6 +64,21 @@ class MissingHostHeaderIntegrationTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void http10WithInvalidHostHeaderServesHealth() throws Exception {
|
||||
String response = rawRequest("GET /_floci/health HTTP/1.0\r\nHost: a b\r\n\r\n");
|
||||
|
||||
assertThat(response, startsWith("HTTP/1.0 200 OK"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void http11WithInvalidHostHeaderIsRejected() throws Exception {
|
||||
String response = rawRequest(
|
||||
"GET /_floci/health HTTP/1.1\r\nHost: a b\r\nConnection: close\r\n\r\n");
|
||||
|
||||
assertThat(response, startsWith("HTTP/1.1 400 Bad Request"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void http11WithoutHostHeaderIsRejected() throws Exception {
|
||||
String response = rawRequest("GET /_floci/health HTTP/1.1\r\nConnection: close\r\n\r\n");
|
||||
|
||||
Reference in new issue
Block a user