Code Monkey home page Code Monkey logo

http-server-form-parser's People

Contributors

evll avatar kelunik avatar nevay avatar pato05 avatar peter279k avatar rekryt avatar trowski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

http-server-form-parser's Issues

Remove parseBody?

parseBody() is just a "shortcut" for the BodyParser constructor. IMO we can just remove that, no? I guess we should remove BodyParser implementing Promise like Message and provide a normal method instead.

@bwoebi @trowski Thoughts?

Parsing with StreamingParser fails with file 86kb

I have a form which contains an input file. If I put an image of ~86kb it produces many PHP warning of strpos "Offset not contained in string" and fails with error 500, because it throws "Request body ended unexpectedly".
Using MadelineProto too with Amp.
log.txt

While using https, the stream ended with only ~99.8% of the current length.

I'm using http-server and http-server-form-parser to manage uploads of files. I was testing with files of about 350 MB, but while you can upload files of this size normally with http, with https, the stream is incomplete so my script waits infinitely for it to complete and the browser throws ERR_EMPTY_RESPONSE as a result. With the upload I'm sending the file_size by javascript, if I don't send it, the upload goes right (this approach works fine with http).

the postman upload file error

Unexpected Amp\Http\Server\FormParser\ParseException thrown from RequestHandler::handleRequest(), falling back to error handler. { "exception": {} }

Form parsing fails if last value contains a urlencoded &

            foreach (\explode("&", $body, $this->fieldCountLimit) as $pair) {
                $pair = \explode("=", $pair, 2);
                $field = \urldecode($pair[0]);
                $value = \urldecode($pair[1] ?? "");

                $fields[$field][] = $value;
            }

#Wrong
            if (\strpos($value ?? "", "&") !== false) {
                throw new ParseException("Maximum number of variables exceeded");
            }
#Right
            if (\strpos($$pair[1] ?? "", "&") !== false) {

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.