raku-community-modules / HTTP-Easy

Make HTTP servers (with PSGI support) easily with Raku
Artistic License 2.0
16 stars 19 forks source link

POST with file uploads is broken #11

Open supernovus opened 11 years ago

supernovus commented 11 years ago

Not sure how long this has been broken, but yeah, if you try to use a multipart/form-data POST with a file attachment, stuff breaks, badly.

sergot commented 10 years ago

Hey supernovus!

Actually masak and I figured out that POST requests doesn't work at all.

I guess it's because of .get which returns only the first line (here: https://github.com/supernovus/perl6-http-easy/blob/master/lib/HTTP/Easy.pm6#L57) and later we want to extract the header from what we've just .get - which is incorrect. Going further we can't read the content because we dont have the Content-Length field and so on... :)

supernovus++ # a lot of work done

supernovus commented 10 years ago

I due seem to remember planning on a rewrite of a bunch of these libraries. I'm guessing this is one that is in need of some fairly substantial changes in order to work as expected.

sergot commented 10 years ago

I will try to find some time to fix this. :)

.recv would help, then some refactoring and.. we'll see.

sergot commented 10 years ago

Quick solution: https://github.com/supernovus/perl6-http-easy/commit/7a6b55353c1f5d4176a5a0d8f7fea41d93f57d4a should be enough, take a look.

We should check this commit, it may contain some redundant code or something. :)