Open tilsche opened 3 years ago
I have encountered servers that send content disposition headers with extra semicolons at the end, e.g.
Content-Disposition: inline; filename="foo.obj";
I understand this is technically non-conforming, but it still contains useful and easily correctly parsable information.
aiohttp should gracefully handle minor non-conformance and include the content_disposition with values. It can still emit a warning.
content_disposition
Fixing this in all broken servers is highly unlikely.
Client
Both chromium and wget --content-disposition treat these cases gracefully.
wget --content-disposition
It is a small change to continue here: https://github.com/aio-libs/aiohttp/blob/a1158c5389854f9885c30e08b0020e2d7d8a290f/aiohttp/multipart.py#L112
continue
Alternative solutions with increasing strictness would be to
I'm happy to create a PR with the preferred solution.
I think option 2 covers most cases. Pull Request is welcome!
Is your feature request related to a problem?
I have encountered servers that send content disposition headers with extra semicolons at the end, e.g.
Content-Disposition: inline; filename="foo.obj";
I understand this is technically non-conforming, but it still contains useful and easily correctly parsable information.
Describe the solution you'd like
aiohttp should gracefully handle minor non-conformance and include the
content_disposition
with values. It can still emit a warning.Describe alternatives you've considered
Fixing this in all broken servers is highly unlikely.
Related component
Client
Additional context
Both chromium and
wget --content-disposition
treat these cases gracefully.It is a small change to
continue
here: https://github.com/aio-libs/aiohttp/blob/a1158c5389854f9885c30e08b0020e2d7d8a290f/aiohttp/multipart.py#L112Alternative solutions with increasing strictness would be to
I'm happy to create a PR with the preferred solution.
Code of Conduct