Skip to content

Commit

Permalink
Allow non-empty lines after status code from a HTTP proxy.
Browse files Browse the repository at this point in the history
  • Loading branch information
gsliepen committed Oct 13, 2016
1 parent ed20896 commit 30cc854
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/proxy.c
Expand Up @@ -256,7 +256,12 @@ int receive_proxy_meta(connection_t *c, int start, int lenin) {
char *p = memchr(c->buffer, '\n', c->buflen);
if(!p || p - c->buffer >= c->buflen)
return 0;
p = memchr(p + 1, '\n', c->buflen - (p + 1 - c->buffer));

while(p = memchr(p + 1, '\n', c->buflen - (p + 1 - c->buffer))) {
if(p[-1] == '\n')
break;
}

if(!p)
return 0;

Expand Down

0 comments on commit 30cc854

Please sign in to comment.