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

Content-Type header parser #259

Merged
merged 9 commits into from
Mar 10, 2025
Merged

Conversation

nnsee
Copy link
Contributor

@nnsee nnsee commented Feb 28, 2025

This fixes #257.

Added a spec-compliant (as far as I can tell) header parser for the Content-Type header, specifically in regards to the boundary param. Also added some tests for the new parser and form.nim.

@nnsee
Copy link
Contributor Author

nnsee commented Feb 28, 2025

I don't know why the tests fail. It also fails on devel even without my changes. And the process seems to hang.

@ringabout
Copy link
Member

The devel actually passes the tests because circle CI is unused though it still causes failures. I guess there is a loop which causes the hang

@ringabout ringabout closed this Feb 28, 2025
@ringabout ringabout reopened this Feb 28, 2025
@PhilippMDoerner
Copy link
Contributor

Out of curiosity, what blocks this? A fix for the test-suite?

@ringabout
Copy link
Member

ringabout commented Mar 7, 2025

I think so. Besides, I could merge a workaround PR to replace rfind with find => #260

@nnsee
Copy link
Contributor Author

nnsee commented Mar 7, 2025

I don't think the test suite issue is from my side, try to run the test suite on just the master branch of this repo and see if it exhibits the same behavior, I'm pretty sure it does.

@ringabout
Copy link
Member

It seems that #263 the cookie dep causes the hang

@PhilippMDoerner
Copy link
Contributor

I think before I go any deeper into this: I'm happy to do a codereview here, if my style of code that I tend to strive for and find most readable works for y'all.

As in, I am very thankful you took the time to implement this Ras, I'd just love to split a few things out for example to have a few smaller procs that do individual tasks like a "parseMediaType" proc that returns a parsed media-type and media-type start- and end-indexes etc.
My goal there would be that ideally you don't need to know the RFCs to understand the code, the variable names and proc names tell you everything you need while isolating smaller individual tasks.

However, if that looks like it does more work than it's worth I'm happy to drop that.

Copy link
Member

@ringabout ringabout left a comment

Choose a reason for hiding this comment

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

Nice work!

@PhilippMDoerner
Copy link
Contributor

Overall, LGTM. A couple suggestions that you can heed if you want to, I'll leave that up to you.

@nnsee
Copy link
Contributor Author

nnsee commented Mar 10, 2025

Thanks for the code review!

@ringabout ringabout merged commit 09ac7ac into planety:devel Mar 10, 2025
2 checks passed
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.

multipart/form-data broken on new firefox version
3 participants