gonzalocasas / node-proxy-middleware

proxy as middleware
MIT License
146 stars 65 forks source link

Don't try to pipe from the original request if there's nothing there. #5

Closed MattCheely closed 11 years ago

MattCheely commented 11 years ago

I was getting socket hang up errors when trying to proxy basic get requests. It seems the proxy was trying to pipe the original request body through, even when there's nothing to pipe. This resolves that issue.

andrewrk commented 11 years ago

Cool. Looks like a good PR. How hard do you think it would be to add a test for it?

MattCheely commented 11 years ago

It should be pretty easy - I'll add one soon.

MattCheely commented 11 years ago

I should have written that test from the start - it helped me discover that the issue was due to an interaction with connect.directory. Looking at the connect.directory source, I don't see anything obvious in there that would end the request stream, but I think the patch is sane regardless of what connect.directory is doing.

andrewrk commented 11 years ago

0.2.0