GithubHelp home page GithubHelp logo

Final part has extra \r\n on end about needle HOT 6 CLOSED

tomas avatar tomas commented on June 20, 2024
Final part has extra \r\n on end

from needle.

Comments (6)

tomas avatar tomas commented on June 20, 2024

Which part? I've tested on a number of different servers and it works without a problem (I actually read the spec for multipart POST's). If you can show an example it'd also help.

from needle.

OrangeDog avatar OrangeDog commented on June 20, 2024

Using https://github.com/felixge/node-formidable as the parser in the server, and sending a single field via multipart, the end of the request looks like this:

----------------------NODENEEDLEHTTPCLIENT
Content-Disposition: form-data; name="name"

value

----------------------NODENEEDLEHTTPCLIENT--

And on the server JSON.stringify(params.name) gives "value\r\n"

from needle.

OrangeDog avatar OrangeDog commented on June 20, 2024

The problem is that "\r\n" is added to the end of every return_part, and then duplicated at the start of the final boundary.

from needle.

tomas avatar tomas commented on June 20, 2024

Ok I'll do a test with formidable and fix it if needed. Thanks for the heads up.

from needle.

abh avatar abh commented on June 20, 2024

I agree with OrangeDog that the current code looks wrong in this respect. :-)

from needle.

tomas avatar tomas commented on June 20, 2024

Ok, tested with formidable. Removing the last \r\n before the final boundary does work. I reread the spec and indeed there is no mention of a double \r\n at the end -- don't really remember why I added it in the first place -- so I'm removing it. Thanks guys.

from needle.

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.