Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly handle newline detection not only for open boundary but for close mark too #3758

Merged
merged 2 commits into from
May 13, 2019

Conversation

asvetlov
Copy link
Member

#3520 introduced an error on the master.
It adds a test where closing multipart boundary is present before opening one.
The test has a conflict with newline style (\n vs \r\n) detection.
This PR fixes the conflict.

@kxepal please review.

@asvetlov asvetlov requested a review from kxepal May 12, 2019 22:25
@codecov-io
Copy link

codecov-io commented May 12, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@0ad5d90). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #3758   +/-   ##
=========================================
  Coverage          ?   97.93%           
=========================================
  Files             ?       43           
  Lines             ?     8569           
  Branches          ?     1375           
=========================================
  Hits              ?     8392           
  Misses            ?       74           
  Partials          ?      103
Impacted Files Coverage Δ
aiohttp/multipart.py 97.03% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0ad5d90...5bfb874. Read the comment docs.

@arthurdarcet
Copy link
Contributor

Thanks, sorry I missed this!

Copy link
Member

@kxepal kxepal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@kxepal
Copy link
Member

kxepal commented May 13, 2019

It adds a test where closing multipart boundary is present before opening one.

But is this a well formed multipart? I fear with allowing empty multiparts we just also allowed handling malformed multiparts.

@asvetlov
Copy link
Member Author

At least the test has a first multipart chunk like --boundary--\r\n while --boundary\r\n was expected.
IIRC in conversation @arthurdarcet convinced that at lease urllib3 and email.message allows a lone closing boundary

@asvetlov asvetlov merged commit 7531fee into master May 13, 2019
@asvetlov asvetlov deleted the postfix-3520 branch May 13, 2019 08:24
@lock lock bot added the outdated label May 20, 2020
@lock lock bot locked as resolved and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants