HttpProtocolDetectorTest
Tests
| Test |
Method name |
Duration |
Result |
| 일반 HTTP 요청 (Upgrade 헤더 없음)은 HTTP/1.1을 반환한다 |
should_return_http_for_normal_http_request() |
0s |
passed |
| [1] httpMethod=GET |
should_return_http_when_buffer_starts_with_http_method(String)[1] |
0.001s |
passed |
| [2] httpMethod=POST |
should_return_http_when_buffer_starts_with_http_method(String)[2] |
0.001s |
passed |
| [3] httpMethod=PUT |
should_return_http_when_buffer_starts_with_http_method(String)[3] |
0s |
passed |
| [4] httpMethod=DELETE |
should_return_http_when_buffer_starts_with_http_method(String)[4] |
0s |
passed |
| [5] httpMethod=HEAD |
should_return_http_when_buffer_starts_with_http_method(String)[5] |
0.001s |
passed |
| [6] httpMethod=OPTIONS |
should_return_http_when_buffer_starts_with_http_method(String)[6] |
0s |
passed |
| [7] httpMethod=PATCH |
should_return_http_when_buffer_starts_with_http_method(String)[7] |
0s |
passed |
| [8] httpMethod=TRACE |
should_return_http_when_buffer_starts_with_http_method(String)[8] |
0s |
passed |
| 빈 버퍼가 주어지면 'UNKNOWN'을 반환한다 |
should_return_unknown_for_empty_buffer() |
0.001s |
passed |
| WebSocket Upgrade 요청은 UNKNOWN을 반환한다 (WebSocketProtocolDetector가 처리하도록) |
should_return_unknown_for_websocket_upgrade_request() |
0.001s |
passed |
| 대소문자 구분 없이 Upgrade: WebSocket 헤더도 UNKNOWN을 반환한다 |
should_return_unknown_for_websocket_with_capital_letters() |
0.001s |
passed |
| Connection 헤더에 다중 값이 있는 WebSocket 요청은 UNKNOWN을 반환한다 |
should_return_unknown_for_websocket_with_multiple_connection_values() |
0.001s |
passed |
| 버퍼가 HTTP 메서드로 시작하지 않으면 'UNKNOWN'을 반환한다 |
should_return_unknown_when_buffer_does_not_start_with_http_method() |
0s |
passed |
Standard output
full header is GET /ws HTTP/1.1
Host: example.com
Upgrade: WebSocket
Connection: Upgrade
full header is GET /ws/benchmark HTTP/1.1
Host: localhost:8080
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==
Sec-WebSocket-Version: 13
full header is GET /index.html HTTP/1.1
Host: example.com
full header is POST /index.html HTTP/1.1
Host: example.com
full header is PUT /index.html HTTP/1.1
Host: example.com
full header is DELETE /index.html HTTP/1.1
Host: example.com
full header is HEAD /index.html HTTP/1.1
Host: example.com
full header is OPTIONS /index.html HTTP/1.1
Host: example.com
full header is PATCH /index.html HTTP/1.1
Host: example.com
full header is TRACE /index.html HTTP/1.1
Host: example.com
full header is GET /api/users HTTP/1.1
Host: example.com
Accept: application/json
full header is GET /ws HTTP/1.1
Host: localhost:8080
Connection: keep-alive, Upgrade
Upgrade: websocket