Set headersonly for parsing header data.#996
Conversation
http.client's parse_headers ends up providing only header data to parsestr, but doesn't set the headersonly option. This ends up generating warning for StartBoundaryNotFoundDefect. This only corrects this defect.
|
@pareshverma91, thanks for your PR! By analyzing the history of the files in this pull request, we identified @serhiy-storchaka, @orsenthil and @vadmium to be potential reviewers. |
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA. This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. Thanks again to your contribution and we look forward to looking at it! |
| break | ||
| hstring = b''.join(headers).decode('iso-8859-1') | ||
| return email.parser.Parser(_class=_class).parsestr(hstring) | ||
| return email.parser.Parser(_class=_class).parsestr(hstring, headersonly=True) |
There was a problem hiding this comment.
For a change like this, please
- Please create bugs.python.org ticket, and show us the problem with steps to reproduce.
- Show how this fixes along with a tests.
- We need to document this too.
This patch is incomplete (even for review) without all three above.
There was a problem hiding this comment.
Sounds good. I have created a bug at https://bugs.python.org/issue29991. I will soon send out an update to the PR with some tests.
|
@pareshverma91 small problem, the title of this commit should change, start with |
|
It seems the same resolution was suggested under https://bugs.python.org/issue29353 2 months ago. The discussion is still ongoing, but closing this PR and the corresponding bug as duplicate. Thanks. |
http.client's parse_headers ends up providing only header data to parsestr, but
doesn't set the headersonly option. This ends up generating warning for
StartBoundaryNotFoundDefect. This only corrects this defect.
urllib3/urllib3#800 is related.