From b031b9d2cb1bd0434ce2891ce20a65a5b5b29796 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 21 Apr 2009 11:14:51 -0700 Subject: http11: rfc2616 handling of absolute URIs We now parse the scheme, host and port from Absolute URIs and ignore them if the equivalents are specified in the other headers. --- ext/unicorn/http11/http11_parser.rl | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ext/unicorn/http11/http11_parser.rl') diff --git a/ext/unicorn/http11/http11_parser.rl b/ext/unicorn/http11/http11_parser.rl index 991ba58..9894276 100644 --- a/ext/unicorn/http11/http11_parser.rl +++ b/ext/unicorn/http11/http11_parser.rl @@ -10,6 +10,8 @@ static void http_field(void *data, const char *field, size_t flen, const char *value, size_t vlen); static void request_method(void *data, const char *at, size_t length); +static void scheme(void *data, const char *at, size_t length); +static void host(void *data, const char *at, size_t length); static void request_uri(void *data, const char *at, size_t length); static void fragment(void *data, const char *at, size_t length); static void request_path(void *data, const char *at, size_t length); @@ -75,6 +77,8 @@ static void downcase_char(char *c) action request_method { request_method(parser->data, PTR_TO(mark), LEN(mark, fpc)); } + action scheme { scheme(parser->data, PTR_TO(mark), LEN(mark, fpc)); } + action host { host(parser->data, PTR_TO(mark), LEN(mark, fpc)); } action request_uri { request_uri(parser->data, PTR_TO(mark), LEN(mark, fpc)); } -- cgit v1.2.3-24-ge0c7