Test response trailers.
(host, port)
| 176 | |
| 177 | |
| 178 | def test_trailers(host, port): |
| 179 | """Test response trailers.""" |
| 180 | print("\n=== Testing Response Trailers ===") |
| 181 | |
| 182 | try: |
| 183 | sock, h2_conn = create_h2_connection(host, port) |
| 184 | |
| 185 | response = h2_request(sock, h2_conn, 1, 'GET', '/trailers', f'{host}:{port}') |
| 186 | print(f"Status: {response['status']}") |
| 187 | print(f"Headers: {response['headers']}") |
| 188 | |
| 189 | if response['trailers']: |
| 190 | print(f"Trailers received: {response['trailers']}") |
| 191 | if 'content-md5' in response['trailers']: |
| 192 | print(f" Content-MD5: {response['trailers']['content-md5']}") |
| 193 | else: |
| 194 | print("Note: No trailers received (client may not have advertised support)") |
| 195 | |
| 196 | sock.close() |
| 197 | return response['status'] == 200 |
| 198 | except Exception as e: |
| 199 | print(f"ERROR: {e}") |
| 200 | return False |
| 201 | |
| 202 | |
| 203 | def test_combined(host, port): |
no test coverage detected