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

support filename* #52

Open
xgjhlws opened this issue May 11, 2023 · 4 comments
Open

support filename* #52

xgjhlws opened this issue May 11, 2023 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@xgjhlws
Copy link

xgjhlws commented May 11, 2023

Is it possiable to support field filename* ?

https://datatracker.ietf.org/doc/html/rfc6266#section-5

@xgjhlws
Copy link
Author

xgjhlws commented May 11, 2023

Because C# has encoded filename to base64.When C# send multipart request to Rust, it can not parse filename correctly.

@xgjhlws
Copy link
Author

xgjhlws commented May 11, 2023

In C#, send request like this:
image
image

In Rust, can only receive like this:
image

@SergioBenitez
Copy link
Member

Sure, I don't see why we can't do this. Happy to accept a PR.

@soundslocke
Copy link

I'm working with an Axum application (holiday coding 🎄 🎉) and hit a similar issue as this when a client sent name*= as an "extended" content disposition field instead of name=.

I'm thinking it may not be correct behavior for clients to set extended field names but some definitely do this. See RFC 7578 Section 4.2 and this rationale.

I'm also thinking it's okay to be permissive about it on the server side. I dove down the rabbit hole and tackled parsing extended fields (i.e. name*= and filename*=) as well as a TODO comment that had been left in the parsing code to handle fields in a case-insensitive way.

I added tests for the new functionality, fixed a Cargo conditional compilation warning, and moved things from constants.rs to content_disposition.rs. Hopefully that all makes sense.

See my branch here: master...soundslocke:multer:extended-content-disposition-field-parsing

Would you still be happy to have a PR for this @SergioBenitez?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants