Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Lib/http/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,8 @@ def putrequest(self, method, url, skip_host=False,
raise CannotSendRequest(self.__state)

# Save the method for use later in the response phase
self._method = method
# ASCII helps prevent http header injection
self._method = method.encode('ascii')

url = url or '/'
self._validate_path(url)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Prevent http header injection by encoding method parameter in
http.client.putrequest(...) to ASCII.