Merge pull request #50 from jedisct1/parse-requests-with-hosts-and-empty-path
Accept requests like <method> <protocol>://<host> <http version>
This commit is contained in:
commit
79ec9bd610
1 changed files with 2 additions and 4 deletions
|
@ -762,6 +762,8 @@ htparser_run(htparser * p, htparse_hooks * hooks, const char * data, size_t len)
|
|||
p->port_offset = &p->buf[p->buf_idx];
|
||||
p->state = s_port;
|
||||
break;
|
||||
case ' ':
|
||||
i--;
|
||||
case '/':
|
||||
p->path_offset = &p->buf[p->buf_idx];
|
||||
|
||||
|
@ -770,10 +772,6 @@ htparser_run(htparser * p, htparse_hooks * hooks, const char * data, size_t len)
|
|||
|
||||
p->state = s_after_slash_in_uri;
|
||||
break;
|
||||
case ' ':
|
||||
/* p->buf should contain the whole uri */
|
||||
p->state = s_http_09;
|
||||
break;
|
||||
default:
|
||||
p->error = htparse_error_inval_schema;
|
||||
return i + 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue