199 Commits

Author SHA1 Message Date
12542a8032 add UNCList directive on Windows
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918549 13f79535-47bb-0310-9956-ffa450edef68
2024-06-24 17:19:44 +00:00
3ed9d65b05 *) mod_http2: added support for bootstrapping WebSockets via HTTP/2, as
described in RFC 8441. A new directive 'H2WebSockets on|off' has been
     added. The feature is by default not enabled.
     As also discussed in the manual, this feature should work for setups
     using "ProxyPass backend-url upgrade=websocket" without further changes.
     Special server modules for WebSockets will have to be adapted,
     most likely, as the handling if IO events is different with HTTP/2.
     HTTP/2 WebSockets are supported on platforms with native pipes. This
     excludes Windows.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910507 13f79535-47bb-0310-9956-ffa450edef68
2023-06-20 12:01:09 +00:00
18fb718292 core: axe struct core_net_rec.
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
2020-12-14 18:08:49 +00:00
6bf5bd6cb2 core: Remove support for the Content-MD5 header, removed in RFC7231.
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
2020-07-03 12:44:53 +00:00
8de97e5fab "[mod_dav_fs etag handling] should really honor the FileETag setting".
- 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
2020-06-27 23:41:00 +00:00
118b51d6d6 Axe remainder from r1875947.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1876595 13f79535-47bb-0310-9956-ffa450edef68
2020-04-16 11:04:03 +00:00
086fce570c Change the position of the 'response_code_exprs' field in the '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
2019-10-23 18:58:16 +00:00
807a365d91 Merge consecutive slashes in the URL by default
opt-out w/ `MergeSlashes OFF`.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1855705 13f79535-47bb-0310-9956-ffa450edef68
2019-03-17 14:41:10 +00:00
19e9326dbf Add StrictHostCheck
.. 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
2018-08-14 21:47:22 +00:00
ed8996d9a0 core: Add ReadBufferSize, FlushMaxThreshold and FlushMaxPipelined directives.
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
2018-07-16 12:49:55 +00:00
2b92ff77a7 core: Create a conn_config_t structure to hold an extendable core config rather
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
2018-02-17 21:39:53 +00:00
411dd32a0d Complete r1764961, missed .h updates
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1765115 13f79535-47bb-0310-9956-ffa450edef68
2016-10-16 02:09:45 +00:00
f54c03b7ee Folding StrictWhitespace into the Strict ruleset of RFC7230, per dev@ poll.
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
2016-08-29 13:47:27 +00:00
6cae6f2487 Rename LenientWhitespace to UnsafeWhitespace and change StrictWhitespace
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
2016-08-25 01:46:20 +00:00
b9a6a0ee7b Introduce StrictURI|UnsafeURI for RFC3986 enforcement
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756959 13f79535-47bb-0310-9956-ffa450edef68
2016-08-19 19:48:58 +00:00
8d77efe21e Perform correct, strict parsing of the request line, handling the
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
2016-08-18 07:15:06 +00:00
35f12766bc Correct AP_HTTP_CONFORMANCE_ flags with an ap_mmn.h bump
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756555 13f79535-47bb-0310-9956-ffa450edef68
2016-08-16 22:29:39 +00:00
9b6702a85c Add CGIVar directive for configuring REQUEST_URI behavior
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
2016-03-14 15:42:45 +00:00
6b699156cd Correct doxygen groupname
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1730128 13f79535-47bb-0310-9956-ffa450edef68
2016-02-12 22:06:01 +00:00
9d9b20f5a9 Introduce an ap_get_useragent_host() accessor to replace the old
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
2016-02-12 01:04:58 +00:00
db5f097737 Unwind commit 1729901 (and 1729926), it was not ready for trunk
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1729928 13f79535-47bb-0310-9956-ffa450edef68
2016-02-12 00:46:00 +00:00
1dd2be03ad Introduce an ap_get_useragent_host() accessor to replace the old
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
2016-02-11 21:58:45 +00:00
4e46f910d0 Revert r1729897, 1729898, my copy of core.c was polluted by a different patch
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1729899 13f79535-47bb-0310-9956-ffa450edef68
2016-02-11 21:52:12 +00:00
6947916643 Introduce an ap_get_useragent_host() accessor to replace the old
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
2016-02-11 21:43:32 +00:00
38a88646a9 from feedback, assume all parameters to SetHandler are expressions.
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
2016-01-22 15:30:19 +00:00
e89938830a allow expressions to be used in SetHandler. Opt-in with expr= prefix.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725149 13f79535-47bb-0310-9956-ffa450edef68
2016-01-17 23:40:09 +00:00
6bbb79daaa Use 'unsigned int' instead of 'int' for bitfields
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1721139 13f79535-47bb-0310-9956-ffa450edef68
2015-12-21 12:17:32 +00:00
28d2d12241 Make the fix for fully qualifying REDIRECT_URL from PR#57785 opt-in.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1710380 13f79535-47bb-0310-9956-ffa450edef68
2015-10-24 19:13:16 +00:00
2da6c9a57a Add the AsyncFilter directive that allows the asynchronous filter
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
2015-10-06 22:33:03 +00:00
615f97f933 core: Extend support for asynchronous write completion from the
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
2015-10-04 10:10:51 +00:00
58119ed85c new directive ProtocolsHonorOrder, added documentation for Protocols 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
2015-08-13 15:33:07 +00:00
b9ba839d50 new Protocols directive and core API changes to enable protocol switching on 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
2015-07-24 12:09:44 +00:00
9850539bd7 core: Add expression support to ErrorDocument. Switch from a fixed
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
2015-02-21 23:59:05 +00:00
0271656a56 Revert r4635428 corresponding to PR41867.
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
2015-01-21 21:39:55 +00:00
d49e6f0ad9 core: Add CGIPassAuth directive to control whether HTTP authorization
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
2014-12-02 12:20:21 +00:00
7dd5dc8bf6 core: Do not match files when using DirectoryMatch. PR41867.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1635428 13f79535-47bb-0310-9956-ffa450edef68
2014-10-30 08:34:12 +00:00
8cc5e00f9e *) SECURITY: CVE-2013-5704 (cve.mitre.org)
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
2014-07-15 19:11:02 +00:00
b122567955 Add in the concept of "slave" connections...
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
2014-02-07 13:54:38 +00:00
93143eb07b Add directives to control two protocol options:
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
2013-12-30 20:01:14 +00:00
43e022f007 core: Support named groups and backreferences within the LocationMatch,
DirectoryMatch, FilesMatch and ProxyMatch directives.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1554300 13f79535-47bb-0310-9956-ffa450edef68
2013-12-30 19:50:52 +00:00
f978691360 Follow-up to r1541029:
Clarify handling of the directive argument


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1544156 13f79535-47bb-0310-9956-ffa450edef68
2013-11-21 12:23:49 +00:00
452c223fe6 Add parse_errorlog_arg callback to ap_errorlog_provider to allow providers
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
2013-11-12 12:14:50 +00:00
528855d544 Error log providers need to be able to trigger a startup error from their
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
2013-09-27 17:52:13 +00:00
904b3f8d8b Add AP_ERRORLOG_PROVIDER_ADD_EOL_STR flag for ap_errorlog_provider, bump MMN.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1525845 13f79535-47bb-0310-9956-ffa450edef68
2013-09-24 11:03:55 +00:00
59bb55791e Add ap_errorlog_provider to make ErrorLog logging modular. Move
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
2013-09-23 14:02:27 +00:00
286e82c27d *) core: merge AllowEncodedSlashes from the base configuration into
(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
2013-06-25 02:48:25 +00:00
f726113d33 Add an option to enforce stricter HTTP conformance
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
2012-12-30 01:23:24 +00:00
b5c0966006 Change HttpProtocol to again only allow to enable/disable 0.9
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
2012-12-22 22:55:38 +00:00
d04d01c589 Add LogLevelOverride directive that allows to override the loglevel for
clients from certain IPs


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1418767 13f79535-47bb-0310-9956-ffa450edef68
2012-12-08 22:16:31 +00:00
6b24eb5bb9 fixed types since MSVC doesnt have uint*_t.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1417585 13f79535-47bb-0310-9956-ffa450edef68
2012-12-05 18:46:35 +00:00