FloydATC has asked for the wisdom of the Perl Monks concerning the following question:
Esteemed monks,
While reading from a non-blocking socket, I am trying to detect HTTP requests, complete with any POST data, within a scalar.
My first thought was to use HTTP::Request but it seems the ->parse() method will rather return an incomplete/invalid request than fail, and partial requests ruin everything.
As of now, I've been manually parsing content-length and chunked transfer encoding, but this is both slow and error-prone so I'd much rather lean on someone with broader experience than myself.
Any thoughts?
I got 99 problems, most of them have to do with printers.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Check if a scalar contains a complete HTTP request
by Corion (Patriarch) on May 20, 2017 at 09:30 UTC | |
by FloydATC (Deacon) on May 20, 2017 at 11:02 UTC | |
by Marshall (Canon) on May 20, 2017 at 16:14 UTC | |
by FloydATC (Deacon) on May 22, 2017 at 07:57 UTC | |
by Marshall (Canon) on May 22, 2017 at 19:36 UTC | |
| |
|
Re: Check if a scalar contains a complete HTTP request
by Anonymous Monk on May 20, 2017 at 15:53 UTC | |
by FloydATC (Deacon) on May 22, 2017 at 15:07 UTC |