Coder Social home page Coder Social logo

Comments (8)

FroMage avatar FroMage commented on July 18, 2024 1

Also, I'm curious as to how the HTTP message looks like. Seems obvious we have a bug, because we assume it can be converted to a string, but I wonder what the content-type is set to, for this binary part.

https://www.rfc-editor.org/rfc/rfc7578.html#section-4.4 says the default content-type if missing is text/plain. So that's relevant.

from quarkus.

geoand avatar geoand commented on July 18, 2024 1

https://www.rfc-editor.org/rfc/rfc7578.html#section-4.4 says the default content-type if missing is text/plain. So that's relevant.

Screenshot from 2024-02-09 14-43-54

So it seems like we are not taking into account the fact that the content is not text and automatically assuming it is.
We should fix this, but then that will also require (based on our current state of things), that we assign some kind of fileName to it.

from quarkus.

geoand avatar geoand commented on July 18, 2024 1

#38714 should take care of it

from quarkus.

quarkus-bot avatar quarkus-bot commented on July 18, 2024

/cc @FroMage (resteasy-reactive), @geoand (resteasy-reactive), @stuartwdouglas (resteasy-reactive)

from quarkus.

geoand avatar geoand commented on July 18, 2024

Thanks for the detailed report!

Could you please attach a sample application that behaves as you describe?
It will be really helpful in debugging the issue and adding a proper test when it comes time to fix it.

Thanks!

from quarkus.

technical-debt-collector avatar technical-debt-collector commented on July 18, 2024

I've smacked together a quick reproducer here: multipart-reproducer.zip

I've tried explicitly passing content-types, but the difference it makes from what I can tell is allowing the client to specify the charset to encode the String with. I.e. specifying ISO-8859-1 as the charset using
curl -v -H 'Content-Type: multipart/form-data' -F 'example=<./example.jpg;charset=ISO8859-1' http://localhost:8080/test
won't change anything, but
curl -v -H 'Content-Type: multipart/form-data' -F 'example=<./example.jpg;type="application/octet-stream";charset=ISO8859-1 http://localhost:8080/test
will. Providing ISO-8859-1 as opposed to the UTF-8 default would make the resulting server-side array length smaller, though still wrong.

from quarkus.

technical-debt-collector avatar technical-debt-collector commented on July 18, 2024

Wouldn't changing the type of FormValue:getType from String to byte[] suffice in order to handle all possible content types? I suppose one would still probably prefer some sort of file handling so as to handle large parts though

from quarkus.

geoand avatar geoand commented on July 18, 2024

I am working on a fix now

from quarkus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.