-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
Missing quotes from values #22
Comments
can you clarify what you mean by this? Maybe an expected vs. actual example. |
Expected: --BOUNDARY
Content-Disposition: form-data; name="data"; filename="test.pdf"
Content-Type: application/pdf
%PDF-1.3
... Actual result: --BOUNDARY
Content-Disposition: form-data; filename=test.pdf; name=data
Content-Type: application/pdf
%PDF-1.3
... |
Ah, I see. The relevant code is here: https://github.com/vapor/core/blob/master/Sources/Core/HeaderValue.swift#L60-L66 The question is: do we need quotes? |
I'm not 100% sure, I bet most (if not all) modern browsers can handle it. I read the issue I linked before and there are a bunch of RFCs linked inside it.
https://stackoverflow.com/a/6745788/2124535... As always, browser compatibility is to blame 😠 Excerpt:
|
@tanner0101 After yesterday’s and today’s experience with trying to get multipart POST request get accepted by Cloudinary’s servers, I’m afraid that yes, we totally need this. Thanks to your help on Discord, I was able to write a code that would create almost the same request in my Vapor app as Cloudinary’s libraries (in many different languages and platforms, from Ruby through Node.js, PHP🤢, Django to native iOS) – except Cloudinary’s requests from their Ruby library would get accepted and Vapor’s almost equivalent request wouldn’t. After capturing both requests in Charles proxy, it boiled down to one single difference between these two: Ruby version wrapped all values in quotation marks, Vapor didn’t. So I tried doing something really ugly with So if I may, I’d vote 100% for having values wrapped in quotation marks. It’s not only about browser compatibility but also about compatibility with other servers – true, it’s not the most common use case for most Vapor apps, but it may be relevant from time to time. |
Closing as this was resolved in vapor/core#144 and vapor/vapor#1668. Thank you so much! |
Missing quotes in values other than encoded file content. Interesting discussion in akka/akka-http#386 (includes spec requirements as well as browser compatibility comments)
E.g:
The text was updated successfully, but these errors were encountered: