[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] [PATCH] Add Host header in HTTP/1.1 requests if it's missing.



On Fri, Aug 19, 2011 at 7:14 AM, Leonid Evdokimov <leon@xxxxxxxxxxxx> wrote:
> Hello,
>
> Here is patch to add "host" header to outgoing HTTP/1.1 requests.
> Please, review.
>
> Without the patch libevent-based evhttp-client.c can't get reply from
> any sane server because the request is rejected with "400 Bad request"
> and workaround - adding the header manually - is required.
>

Looks to me as if this should be using the REQ_VERSION_ATLEAST macro.

Other than that, it looks okay.  It'd need some tweaking for https
support, I think, where 443 is the default.  Perhaps the port should
be included unconditionally, if that doesn't break anything: the rfc
says that we _can_ omit port 80, not that we must.

-- 
Nick
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.