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

Multipart-Form-Data in akka-http, missing quotes in Content-Disposition field #387

Closed
KrzyMucha opened this issue Oct 12, 2016 · 2 comments
Milestone

Comments

@KrzyMucha
Copy link
Contributor

When we use akka-http for http request with following code:

Multipart
            .FormData(Multipart.FormData.BodyPart("file",
                HttpEntity.Strict(MediaTypes.`image/jpeg`, ByteString("test")), Map("filename" -> "somefile.jpeg"))).toEntity()

Then Http request is as follows

User-Agent: [akka-http/2.4.8]
Transfer-Encoding: [chunked]
Host: [localhost:8089]
Content-Type: [multipart/form-data; boundary=xWtacaNwjOWLKFExaR8fOv6Q; charset=UTF-8]

--xWtacaNwjOWLKFExaR8fOv6Q
Content-Type: image/jpeg
Content-Disposition: form-data; filename=somefile.jpeg; name=file

test
--xWtacaNwjOWLKFExaR8fOv6Q--

Parameters filename and file are without quotation marks. However following HTTP specification this params should be quoted. As result some servers (ex. "django" app) are not able to see attached files.

@KrzyMucha
Copy link
Contributor Author

Information about requirement I found here: https://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html, paragraph 19.5.1 Content-Disposition

filename-parm = "filename" "=" quoted-string
disp-extension-parm = token "=" ( token | quoted-string )

@ktoso ktoso closed this as completed Oct 12, 2016
@ktoso
Copy link
Member

ktoso commented Oct 12, 2016

Opened this ticket already, closing as duplicate.
Please post here: #386

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

No branches or pull requests

2 participants