summaryrefslogtreecommitdiff
path: root/include/http_core.h
Commit message (Collapse)AuthorAgeFilesLines
* core: axe struct core_net_rec.Yann Ylavic2020-12-141-14/+0
| | | | | | | | It was only used internally (by the core filters), and it's public API was redundant with conn_config_t. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1884431 13f79535-47bb-0310-9956-ffa450edef68
* core: Remove support for the Content-MD5 header, removed in RFC7231.Graham Leggett2020-07-031-2/+0
| | | | | | | | Functions ap_md5digest() and ap_md5contextTo64() removed, and ContentDigest directive. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1879472 13f79535-47bb-0310-9956-ffa450edef68
* "[mod_dav_fs etag handling] should really honor the FileETag setting".Graham Leggett2020-06-271-6/+7
| | | | | | | | | | | | | | | | - It now does. - Add "Digest" to FileETag directive, allowing a strong ETag to be generated using a file digest. - Add ap_make_etag_ex() and ap_set_etag_fd() to allow full control over ETag generation. - Add concept of "binary notes" to request_rec, allowing packed bit flags to be added to a request. - First binary note - AP_REQUEST_STRONG_ETAG - allows modules to force the ETag to a strong ETag to comply with RFC requirements, such as those mandated by various WebDAV extensions. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1879285 13f79535-47bb-0310-9956-ffa450edef68
* Axe remainder from r1875947.Yann Ylavic2020-04-161-1/+0
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1876595 13f79535-47bb-0310-9956-ffa450edef68
* Change the position of the 'response_code_exprs' field in the ↵Christophe Jaillet2019-10-231-7/+6
| | | | | | | | 'core_dir_config' structure. This synch trunk with 2.4.x but it also makes the structure smaller because 2 bietfields are merged. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1868819 13f79535-47bb-0310-9956-ffa450edef68
* Merge consecutive slashes in the URL by defaultEric Covener2019-03-171-0/+1
| | | | | | | | opt-out w/ `MergeSlashes OFF`. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1855705 13f79535-47bb-0310-9956-ffa450edef68
* Add StrictHostCheck Eric Covener2018-08-141-0/+1
| | | | | | | | | | | .. to allow ucnonfigured hostnames to be rejected. The checks happen during NVH mapping and checks that the mapped VH itself has the host as a name or alias. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1838055 13f79535-47bb-0310-9956-ffa450edef68
* core: Add ReadBufferSize, FlushMaxThreshold and FlushMaxPipelined directives.Yann Ylavic2018-07-161-0/+12
| | | | | | | | | | | | | | | | | | | ReadBufferSize allows to configure the size of read buffers, for now it's mainly used for file buckets reads (apr_bucket_file_set_buf_size), but it could be used to replace AP_IOBUFSIZE in multiple places. FlushMaxThreshold and FlushMaxPipelined allow to configure the hardcoded THRESHOLD_MAX_BUFFER and MAX_REQUESTS_IN_PIPELINE from "util_filter.c". The former sets the maximum size above which pending data are forcibly flushed to the network (blocking eventually), and the latter sets the number of pipelined/pending responses above which they are flushed regardless of whether a pipelined request is immediately available (zero disables pipelining). Larger ReadBufferSize and FlushMaxThreshold can trade memory consumption for performances with the capacity of today's networks. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1836032 13f79535-47bb-0310-9956-ffa450edef68
* core: Create a conn_config_t structure to hold an extendable core config rather Graham Leggett2018-02-171-0/+5
| | | | | | | than consuming the whole pointer with the connection socket. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1824635 13f79535-47bb-0310-9956-ffa450edef68
* Complete r1764961, missed .h updatesWilliam A. Rowe Jr2016-10-161-6/+0
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1765115 13f79535-47bb-0310-9956-ffa450edef68
* Folding StrictWhitespace into the Strict ruleset of RFC7230, per dev@ poll.William A. Rowe Jr2016-08-291-5/+0
| | | | | | | | | | | This choice is unanimous, although StrictURI (a different RFC) still hasn't found absolute concensus. An ap_mmn bump will follow (major, this removes a struct elt) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1758226 13f79535-47bb-0310-9956-ffa450edef68
* Rename LenientWhitespace to UnsafeWhitespace and change StrictWhitespaceWilliam A. Rowe Jr2016-08-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | to the default behavior, after discussion with fielding et al about the purpose of section 3.5. Update the documentation to clarify this. This patch removes whitespace considerations from the Strict|Unsafe toggle and consolidates them all in the StrictWhitespace|UnsafeWhitespace toggle. Added a bunch of logic comments to read_request_line parsing. Dropped the badwhitespace list for an all-or-nothing toggle in rrl. Leading space before the method is optimized to be evaluated only once. Toggled the request from HTTP/0.9 to HTTP/1.0 for more BAD_REQUEST cases. Moved s/[\n\v\f\r]/ / cleanup logic earlier in the cycle, to operate on each individual line read, and catch bad whitespace errors earlier. This changes the obs-fold to more efficiently condense whitespace and forces concatinatination with a single SP, always. Overrides are not necessary since obs-fold is clearly deprecated. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1757589 13f79535-47bb-0310-9956-ffa450edef68
* Introduce StrictURI|UnsafeURI for RFC3986 enforcementWilliam A. Rowe Jr2016-08-191-0/+5
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756959 13f79535-47bb-0310-9956-ffa450edef68
* Perform correct, strict parsing of the request line, handling theWilliam A. Rowe Jr2016-08-181-0/+10
| | | | | | | | | | | | | | | | | | | | http protocol tag, url and method appropriately, and attempting to extract values even in the presence of unusual whitespace in keeping with section 3.5, prior to responding with whatever error reply is needed. Conforms to RFC7230 in all respects, the section 3.5 optional behavior can be disabled by the user with a new HttpProtocolOptions StrictWhitespace flag. In all cases, the_request is regenerated from the parsed components with exactly two space characters. Shift sf's 'strict' method check from the Strict behavior because it violates forward proxy logic, adding a new RegisteredMethods flag, as it will certainly be useful to some. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756729 13f79535-47bb-0310-9956-ffa450edef68
* Correct AP_HTTP_CONFORMANCE_ flags with an ap_mmn.h bumpWilliam A. Rowe Jr2016-08-161-2/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756555 13f79535-47bb-0310-9956-ffa450edef68
* Add CGIVar directive for configuring REQUEST_URI behaviorJeff Trawick2016-03-141-0/+3
| | | | | | | | The goal is to use this one directive to handle any configurable CGI variable behavior; only one CGI variable is supported initially. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1734947 13f79535-47bb-0310-9956-ffa450edef68
* Correct doxygen groupnameWilliam A. Rowe Jr2016-02-121-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1730128 13f79535-47bb-0310-9956-ffa450edef68
* Introduce an ap_get_useragent_host() accessor to replace the oldWilliam A. Rowe Jr2016-02-121-1/+27
| | | | | | | | | | | | | | | | | | | ap_get_remote_host() in most applications, but preserve the original behavior for all ap_get_remote_host() consumers (mostly, because we don't have the request_rec in the first place, and also to avoid any unintended consequences). This accessor continues to store the remote_host of connection based uesr agents within the conn_rec for optimization. Only where some other module modifies the useragent_addr will we perform a per-request query of the remote_host. (Fixed compilation issues noted by Ranier, applies to 2.4.x trunk, modulo CHANGES and ap_mmn.h) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1729929 13f79535-47bb-0310-9956-ffa450edef68
* Unwind commit 1729901 (and 1729926), it was not ready for trunkWilliam A. Rowe Jr2016-02-121-27/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1729928 13f79535-47bb-0310-9956-ffa450edef68
* Introduce an ap_get_useragent_host() accessor to replace the oldWilliam A. Rowe Jr2016-02-111-1/+27
| | | | | | | | | | | | | | | | | ap_get_remote_host() in most applications, but preserve the original behavior for all ap_get_remote_host() consumers (mostly, because we don't have the request_rec in the first place, and also to avoid any unintended consequences). This accessor continues to store the remote_host of connection based uesr agents within the conn_rec for optimization. Only where some other module modifies the useragent_addr will we perform a per-request query of the remote_host. (Committed previously, but backed out due to unrelated core.c changes) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1729901 13f79535-47bb-0310-9956-ffa450edef68
* Revert r1729897, 1729898, my copy of core.c was polluted by a different patchWilliam A. Rowe Jr2016-02-111-27/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1729899 13f79535-47bb-0310-9956-ffa450edef68
* Introduce an ap_get_useragent_host() accessor to replace the oldWilliam A. Rowe Jr2016-02-111-1/+27
| | | | | | | | | | | | | | | | ap_get_remote_host() in most applications, but preserve the original behavior for all ap_get_remote_host() consumers (mostly, because we don't have the request_rec in the first place, and also to avoid any unintended consequences). This accessor continues to store the remote_host of connection based uesr agents within the conn_rec for optimization. Only where some other module modifies the useragent_addr will we perform a per-request query of the remote_host. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1729897 13f79535-47bb-0310-9956-ffa450edef68
* from feedback, assume all parameters to SetHandler are expressions.Eric Covener2016-01-221-2/+2
| | | | | | | | I couldnt come up with a plausible handler name that was an invalid expression. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1726233 13f79535-47bb-0310-9956-ffa450edef68
* allow expressions to be used in SetHandler. Opt-in with expr= prefix.Eric Covener2016-01-171-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725149 13f79535-47bb-0310-9956-ffa450edef68
* Use 'unsigned int' instead of 'int' for bitfieldsChristophe Jaillet2015-12-211-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1721139 13f79535-47bb-0310-9956-ffa450edef68
* Make the fix for fully qualifying REDIRECT_URL from PR#57785 opt-in. Eric Covener2015-10-241-0/+13
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1710380 13f79535-47bb-0310-9956-ffa450edef68
* Add the AsyncFilter directive that allows the asynchronous filterGraham Leggett2015-10-061-0/+2
| | | | | | | functionality to be switched off for certain classes of filters. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1707161 13f79535-47bb-0310-9956-ffa450edef68
* core: Extend support for asynchronous write completion from theGraham Leggett2015-10-041-0/+1
| | | | | | | network filter to any connection or request filter. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1706669 13f79535-47bb-0310-9956-ffa450edef68
* new directive ProtocolsHonorOrder, added documentation for Protocols ↵Stefan Eissing2015-08-131-0/+1
| | | | | | feature, changed preference selection and config merging git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1695727 13f79535-47bb-0310-9956-ffa450edef68
* new Protocols directive and core API changes to enable protocol switching on ↵Stefan Eissing2015-07-241-0/+3
| | | | | | HTTP Upgrade or ALPN, implemented in mod_ssl and mod_h2 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1692486 13f79535-47bb-0310-9956-ffa450edef68
* core: Add expression support to ErrorDocument. Switch from a fixedGraham Leggett2015-02-211-6/+8
| | | | | | | sized 664 byte array per merge to a hash table. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1661448 13f79535-47bb-0310-9956-ffa450edef68
* Revert r4635428 corresponding to PR41867.William A. Rowe Jr2015-01-211-1/+0
| | | | | | | | | | | | | | | | | | | | | | The code reverted attempted to restrict comparisons of the r->filename to given DirectoryMatch blocks. r->filename was already a non-directory entity at this point, because we have already fallen out of the } while (thisinfo.filetype == APR_DIR); block above. The addition of r->d_is_directory was redundant. That is what is always returned by ap_get_core_module_config(r->per_dir_config). Note modifying dir_config required an MMN major bump as this commit could have realigned the offset of refs (had it been added to the end, this would correspond to an mmn minor bump) and other fields packed into the same bytes (this is undefined). Bump on revert to prevent unexpected crashes. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1653666 13f79535-47bb-0310-9956-ffa450edef68
* core: Add CGIPassAuth directive to control whether HTTP authorizationJeff Trawick2014-12-021-0/+9
| | | | | | | | | headers are passed to scripts as CGI variables. PR: 56855 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1642847 13f79535-47bb-0310-9956-ffa450edef68
* core: Do not match files when using DirectoryMatch. PR41867.Jan Kaluža2014-10-301-0/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1635428 13f79535-47bb-0310-9956-ffa450edef68
* *) SECURITY: CVE-2013-5704 (cve.mitre.org)Eric Covener2014-07-151-0/+4
| | | | | | | | | | | | | | | core: HTTP trailers could be used to replace HTTP headers late during request processing, potentially undoing or otherwise confusing modules that examined or modified request headers earlier. Adds "MergeTrailers" directive to restore legacy behavior. Submitted By: Edward Lu, Yann Ylavic, Joe Orton, Eric Covener Committed By: covener git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1610814 13f79535-47bb-0310-9956-ffa450edef68
* Add in the concept of "slave" connections...Jim Jagielski2014-02-071-0/+9
| | | | | | | | Allows for several "connections" all resulting in a single real connection that talks to the network. Right now, nothing uses this though. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1565657 13f79535-47bb-0310-9956-ffa450edef68
* Add directives to control two protocol options:Justin Erenkrantz2013-12-301-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | HttpContentLengthHeadZero - allow Content-Length of 0 to be returned on HEAD HttpExpectStrict - allow admin to control whether we must see "100-continue" This is helpful when using Ceph's radosgw and httpd. Inspired by: Yehuda Sadeh <yehuda@inktank.com> See https://github.com/ceph/apache2/commits/precise * include/http_core.h (core_server_config): Add http_cl_head_zero and http_expect_strict fields. * modules/http/http_filters.c (ap_http_header_filter): Only clear out the C-L if http_cl_head_zero is not explictly set. * server/core.c (merge_core_server_configs): Add new fields. (set_cl_head_zero, set_expect_strict): New config helpers. (HttpContentLengthHeadZero, HttpExpectStrict): Declare new directives. * server/protocol.c (ap_read_request): Allow http_expect_strict to control if we return 417. * include/ap_mmn.h (MODULE_MAGIC_NUMBER_MAJOR, MODULE_MAGIC_NUMBER_MINOR): Bump. * CHANGES: Add a brief description. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1554303 13f79535-47bb-0310-9956-ffa450edef68
* core: Support named groups and backreferences within the LocationMatch,Graham Leggett2013-12-301-0/+4
| | | | | | | DirectoryMatch, FilesMatch and ProxyMatch directives. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1554300 13f79535-47bb-0310-9956-ffa450edef68
* Follow-up to r1541029:Jeff Trawick2013-11-211-1/+4
| | | | | | | Clarify handling of the directive argument git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1544156 13f79535-47bb-0310-9956-ffa450edef68
* Add parse_errorlog_arg callback to ap_errorlog_provider to allow providersJan Kaluža2013-11-121-0/+7
| | | | | | | | to check the ErrorLog argument. Implement this check in mod_syslog. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1541029 13f79535-47bb-0310-9956-ffa450edef68
* Error log providers need to be able to trigger a startup error from theirJeff Trawick2013-09-271-0/+4
| | | | | | | init() function. A NULL return code is the trigger. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1527003 13f79535-47bb-0310-9956-ffa450edef68
* Add AP_ERRORLOG_PROVIDER_ADD_EOL_STR flag for ap_errorlog_provider, bump MMN.Jan Kaluža2013-09-241-1/+7
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1525845 13f79535-47bb-0310-9956-ffa450edef68
* Add ap_errorlog_provider to make ErrorLog logging modular. MoveJan Kaluža2013-09-231-2/+26
| | | | | | | syslog support from core to new mod_syslog. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1525597 13f79535-47bb-0310-9956-ffa450edef68
* *) core: merge AllowEncodedSlashes from the base configuration intoEric Covener2013-06-251-0/+2
| | | | | | | | (non-default) name-based virtual hosts. [Eric Covener] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1496339 13f79535-47bb-0310-9956-ffa450edef68
* Add an option to enforce stricter HTTP conformanceStefan Fritsch2012-12-301-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a first stab, the checks will likely have to be revised. For now, we check * if the request line contains control characters * if the request uri has fragment or username/password * that the request method is standard or registered with RegisterHttpMethod * that the request protocol is of the form HTTP/[1-9]+.[0-9]+, or missing for 0.9 * if there is garbage in the request line after the protocol * if any request header contains control characters * if any request header has an empty name * for the host name in the URL or Host header: - if an IPv4 dotted decimal address: Reject octal or hex values, require exactly four parts - if a DNS host name: Reject non-alphanumeric characters besides '.' and '-'. As a side effect, this rejects multiple Host headers. * if any response header contains control characters * if any response header has an empty name * that the Location response header (if present) has a valid scheme and is absolute If we have a host name both from the URL and the Host header, we replace the Host header with the value from the URL to enforce RFC conformance. There is a log-only mode, but the loglevels of the logged messages need some thought/work. Currently, the checks for incoming data log for 'core' and the checks for outgoing data log for 'http'. Maybe we need a way to configure the loglevels separately from the core/http loglevels. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1426877 13f79535-47bb-0310-9956-ffa450edef68
* Change HttpProtocol to again only allow to enable/disable 0.9Stefan Fritsch2012-12-221-4/+5
| | | | | | | | | | | | | | | This reverts r1407643, but changes the syntax of HttpProtocol to min=0.9|1.0, which is less ambiguous than the previous +0.9|-0.9. Allowing to configure an arbitrary version range was a bad idea, because it only checked the version in the request line, without affecting the semantics of the headers, etc. A tighter restriction off the version in the request line is still possible with <If "%{SERVER_PROTOCOL_NUM} ..."> . git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1425366 13f79535-47bb-0310-9956-ffa450edef68
* Add LogLevelOverride directive that allows to override the loglevel forStefan Fritsch2012-12-081-0/+2
| | | | | | | clients from certain IPs git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1418767 13f79535-47bb-0310-9956-ffa450edef68
* fixed types since MSVC doesnt have uint*_t.Gregg Lewis Smith2012-12-051-2/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1417585 13f79535-47bb-0310-9956-ffa450edef68
* Make HttpProtocol accept a range of allowed versions.Stefan Fritsch2012-11-091-4/+3
| | | | | | | Bump MMN git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1407643 13f79535-47bb-0310-9956-ffa450edef68
* New directive HttpProtocol which allows to disable HTTP/0.9 support.Stefan Fritsch2012-11-071-0/+5
| | | | | | | | The syntax is designed to allow addition of a +/- strict option later on. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1406719 13f79535-47bb-0310-9956-ffa450edef68