We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8baa875 commit 7856d27Copy full SHA for 7856d27
Lib/test/test_httpservers.py
@@ -894,6 +894,14 @@ def test_extra_response_headers_get_file(self):
894
'test1=value1, test2=value2')
895
self.assertEqual(response.getheader("X-Test1"), 'value3')
896
897
+ def test_extra_response_headers_missing_on_404(self):
898
+ with mock.patch.object(self.request_handler, 'extra_response_headers', [
899
+ ('X-Test1', 'value'),
900
+ ]):
901
+ response = self.request(self.base_url + '/missing.html')
902
+ self.assertEqual(response.status, 404)
903
+ self.assertEqual(response.getheader("X-Test1"), None)
904
+
905
906
class SocketlessRequestHandler(SimpleHTTPRequestHandler):
907
def __init__(self, directory=None):
0 commit comments