[3.3] bpo-22928: Disabled HTTP header injections in http.client. by serhiy-storchaka · Pull Request #2817 · python/cpython
…lient. Original patch by Demian Brecht.. (cherry picked from commit a112a8a)
|
|
||
| # the patterns for both name and value are more leniant than RFC | ||
| # definitions to allow for backwards compatibility | ||
| _is_legal_header_name = re.compile(rb'[^:\s][^:\r\n]*\Z').match |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Python 2.7 regex starts with \A. Is it useful?
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. match() always matches from the start.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
This file contains hidden or 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