summaryrefslogtreecommitdiffhomepage
path: root/src/test/nxt_http_parse_test.c (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2020-11-17HTTP parser: allowed more characters in header field names.Valentin Bartenev1-7/+31
Previously, all requests that contained in header field names characters other than alphanumeric, or "-", or "_" were rejected with a 400 "Bad Request" error response. Now, the parser allows the same set of characters as specified in RFC 7230, including: "!", "#", "$", "%", "&", "'", "*", "+", ".", "^", "`", "|", and "~". Header field names that contain only these characters are considered valid. Also, there's a new option introduced: "discard_unsafe_fields". It accepts boolean value and it is set to "true" by default. When this option is "true", all header field names that contain characters in valid range, but other than alphanumeric or "-" are skipped during parsing. When the option is "false", these header fields aren't skipped. Requests with non-valid characters in header field names according to RFC 7230 are rejected regardless of "discard_unsafe_fields" setting. This closes #422 issue on GitHub.
2020-04-16Using malloc/free for the http fields hash.Max Romanov1-12/+5
This is required due to lack of a graceful shutdown: there is a small gap between the runtime's memory pool release and router process's exit. Thus, a worker thread may start processing a request between these two operations, which may result in an http fields hash access and subsequent crash. To simplify issue reproduction, it makes sense to add a 2 sec sleep before exit() in nxt_runtime_exit().
2019-09-30HTTP parser: removed unused "exten" field.Valentin Bartenev1-22/+0
This field was intended for MIME type lookup by file extension when serving static files, but this use case is too narrow; only a fraction of requests targets static content, and the URI presumably isn't rewritten. Moreover, current implementation uses the entire filename for MIME type lookup if the file has no extension. Instead of extracting filenames and extensions when parsing requests, it's easier to obtain them right before serving static content; this behavior is already implemented. Thus, we can drop excessive logic from parser.
2019-09-17HTTP parser: fixed parsing of target after literal space character.Valentin Bartenev1-1/+14
In theory, all space characters in request target must be encoded; however, some clients may violate the specification. For the sake of interoperability, Unit supports unencoded space characters. Previously, if there was a space character before the extension or arguments parts, those parts weren't recognized. Also, quoted symbols and complex target weren't detected after a space character.
2019-09-16HTTP parser: removed unused "plus_in_target" flag.Valentin Bartenev1-20/+10
2019-09-16HTTP parser: removed unused "exten_start" and "args_start" fields.Valentin Bartenev1-16/+8
2018-07-03HTTP parser: relaxed checking of fields values.Valentin Bartenev1-1/+1
Allowing characters up to 0xFF doesn't conflict with RFC 7230. Particularly, this make it possible to pass unencoded UTF-8 data through HTTP headers, which can be useful.
2018-03-15HTTP parser: allowing tabs in field values as per RFC 7230.Valentin Bartenev1-0/+24
2018-03-15HTTP parser: restricting allowed characters in fields values.Valentin Bartenev1-0/+18
According to RFC 7230 only printable 7-bit ASCII characters are allowed in field values.
2018-03-15HTTP parser: fixed parsing of field values ending with space.Valentin Bartenev1-0/+6
This closes #82 issue on GitHub.
2018-01-24Fixed formatting in nxt_sprintf() and logging.Sergey Kandaurov1-1/+1
2018-01-24Using size_t for the field width type of the "%*s" specifier.Sergey Kandaurov1-2/+3
2018-01-15Checking for major HTTP version.Valentin Bartenev1-0/+5
2018-01-15HTTP parser: improved error reporting.Valentin Bartenev1-11/+11
2018-01-09HTTP parser: allowing underscore in header field names.Valentin Bartenev1-1/+1
2017-12-25HTTP parser: reworked header fields handling.Valentin Bartenev1-28/+89
2017-11-21Tests: move existing tests to "src" folder.Andrey Zelenkov1-0/+0
2017-08-30Lib unit tests have been renamed to tests.Igor Sysoev1-91/+89
2017-08-22Removed unused structure.Valentin Bartenev1-4/+0
2017-06-20HTTP parser: reduced memory consumption of header fields list.Valentin Bartenev1-61/+44
2017-06-20Fixed errors in the previous changeset.Igor Sysoev1-11/+11
2017-06-13HTTP parser: decoupled header fields processing.Valentin Bartenev1-52/+147
2017-06-09HTTP parser: fixed handling header fields with missing colon.Valentin Bartenev1-0/+12
2017-03-08HTTP parser benchmark.Valentin Bartenev1-3/+176
2017-03-01HTTP parser.Valentin Bartenev1-0/+457