Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c28ab08

Browse files
committed
merge 3.3 (#18574)
2 parents 49776ef + 3836593 commit c28ab08

4 files changed

Lines changed: 9 additions & 3 deletions

File tree

Lib/http/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ def handle_expect_100(self):
355355
356356
"""
357357
self.send_response_only(100)
358-
self.flush_headers()
358+
self.end_headers()
359359
return True
360360

361361
def handle_one_request(self):

Lib/test/test_httpservers.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,8 @@ def test_with_continue_1_0(self):
584584
def test_with_continue_1_1(self):
585585
result = self.send_typical_request(b'GET / HTTP/1.1\r\nExpect: 100-continue\r\n\r\n')
586586
self.assertEqual(result[0], b'HTTP/1.1 100 Continue\r\n')
587-
self.assertEqual(result[1], b'HTTP/1.1 200 OK\r\n')
587+
self.assertEqual(result[1], b'\r\n')
588+
self.assertEqual(result[2], b'HTTP/1.1 200 OK\r\n')
588589
self.verify_expected_headers(result[2:-1])
589590
self.verify_get_called()
590591
self.assertEqual(result[-1], b'<html><body>Data</body></html>\r\n')
@@ -652,7 +653,8 @@ def _readAndReseek(f):
652653
self.assertNotEqual(_readAndReseek(output), b'')
653654
result = _readAndReseek(output).split(b'\r\n')
654655
self.assertEqual(result[0], b'HTTP/1.1 100 Continue')
655-
self.assertEqual(result[1], b'HTTP/1.1 200 OK')
656+
self.assertEqual(result[1], b'')
657+
self.assertEqual(result[2], b'HTTP/1.1 200 OK')
656658

657659
def test_with_continue_rejected(self):
658660
usual_handler = self.handler # Save to avoid breaking any subsequent tests.

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,7 @@ Jeff Ramnani
10521052
Brodie Rao
10531053
Senko Rasic
10541054
Antti Rasinen
1055+
Nikolaus Rath
10551056
Sridhar Ratnakumar
10561057
Ysj Ray
10571058
Eric S. Raymond

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ Core and Builtins
2525
Library
2626
-------
2727

28+
- Issue #18574: Fixed handling of 100-continue reply from server in
29+
http.client.HTTPConnection. Patch by Nikolaus Rath.
30+
2831
- Issue #20270: urllib.urlparse now supports empty ports.
2932

3033
- Issue #20243: TarFile no longer raise ReadError when opened in write mode.

0 commit comments

Comments
 (0)