| 763 | |
| 764 | |
| 765 | def test_file_response_range_multi_head(file_response_client: TestClient) -> None: |
| 766 | response = file_response_client.head("/", headers={"Range": "bytes=0-100, 200-300"}) |
| 767 | assert response.status_code == 206 |
| 768 | assert "content-range" not in response.headers |
| 769 | assert response.headers["content-length"] == "448" |
| 770 | assert response.headers["content-type"].startswith("multipart/byteranges; boundary=") |
| 771 | assert response.content == b"" |
| 772 | |
| 773 | response = file_response_client.head( |
| 774 | "/", |
| 775 | headers={"Range": "bytes=200-300", "if-range": response.headers["etag"][:-1]}, |
| 776 | ) |
| 777 | assert response.status_code == 200 |
| 778 | response = file_response_client.head( |
| 779 | "/", |
| 780 | headers={"Range": "bytes=200-300", "if-range": response.headers["etag"]}, |
| 781 | ) |
| 782 | assert response.status_code == 206 |
| 783 | |
| 784 | |
| 785 | def test_file_response_range_invalid(file_response_client: TestClient) -> None: |