Test that Accept header check is case-insensitive
()
| 301 | |
| 302 | |
| 303 | async def test_accept_header_case_insensitive(): |
| 304 | """Test that Accept header check is case-insensitive""" |
| 305 | exc = HTTPException(status_code=403) |
| 306 | # Mixed case Accept header |
| 307 | request = Request( |
| 308 | { |
| 309 | "type": "http", |
| 310 | "path": "/some/path", |
| 311 | "headers": [(b"accept", b"Application/JSON")], |
| 312 | } |
| 313 | ) |
| 314 | response = await handle_error(request, exc) |
| 315 | assert response.status_code == 401 |
| 316 | assert "WWW-Authenticate" not in response.headers |
| 317 | |
| 318 | |
| 319 | async def test_accept_header_with_multiple_types(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…