/ blog Public
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
blog/en-2018-04-22-on-incomplete-http-reads-and-the-requests-library-in-python/servers/transfer-encoding-chunked.pyGo to file
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
|# An HTTP server that returns fewer bytes in the body of the response than|
|# stated in the chunk size when using "Transfer-Encoding: Chunked".|
|data = self.request.recv(1024)|
|b'HTTP/1.1 200 OK\r\n'|
|b'a\r\n' # size of the chunk (0xa = 10)|
|allow_reuse_address = True|
|with MyTCPSever(('localhost', 8080), MyTCPHandler) as server:|