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

Make multipart parsing more forgiving: start-of-line and casing #1164

Merged
merged 2 commits into from
Apr 6, 2024

Conversation

NHDaly
Copy link
Collaborator

@NHDaly NHDaly commented Apr 5, 2024

I had a multipart response i wanted to parse, and julia failed to parse it. These changes let it parse:

  1. The content-disposition was the second line in each part, with the content-type coming first, so the ^ was failing to parse.
  2. The content-type: key was lower-cased, not Title-Cased as expected.

Dunno if these are generally correct, but they worked in my case.

I had a multipart response i wanted to parse, and julia failed to parse
it. These changes let it parse:
1. The content-disposition was the _second_ line in each part, with the
   content-type coming first, so the `^` was failing to parse.
2. The `content-type:` key was lower-cased, not Title-Cased as expected.

Dunno if these are generally correct, but they worked in my case.
@NHDaly NHDaly requested a review from quinnj April 5, 2024 17:15
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.19%. Comparing base (2de2c78) to head (9387824).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1164   +/-   ##
=======================================
  Coverage   83.19%   83.19%           
=======================================
  Files          32       32           
  Lines        3058     3058           
=======================================
  Hits         2544     2544           
  Misses        514      514           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@quinnj quinnj left a comment

Choose a reason for hiding this comment

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

Seems fine to me; could we add a test case that covers what was previously failing?

@quinnj quinnj merged commit ec69a01 into master Apr 6, 2024
11 checks passed
@quinnj quinnj deleted the nhd-multipart-parsing-content-disp branch April 6, 2024 17:21
@quinnj
Copy link
Member

quinnj commented Apr 6, 2024

Let me know if this is needed in a release (for 0.9 or 0.10), otherwise, I'll let is sit on master until a new release is needed.

@NHDaly
Copy link
Collaborator Author

NHDaly commented Apr 9, 2024

not needed; i was just trying to be a good citizen here and fix a bug I found. 😊 thanks! 👋

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants