1
0
mirror of https://github.com/apache/httpd.git synced 2026-10-23 22:49:01 +03:00

1239 Commits

Author SHA1 Message Date
Eric Covener
863594b373 Merge r1938649 from trunk:
don't use CT as handler



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1938650 13f79535-47bb-0310-9956-ffa450edef68
2026-09-29 08:16:44 +00:00
Jim Jagielski
5b934373e3 https://github.com/apache/httpd/pull/703.patch
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1937719 13f79535-47bb-0310-9956-ffa450edef68
2026-09-01 10:27:29 +00:00
Jim Jagielski
937f117a11 *) include/httpd.h: Define HTTP_EARLY_HINTS (103) per RFC 8297.
modules/http/http_protocol.c (status_lines): Add 103 response.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1935818 13f79535-47bb-0310-9956-ffa450edef68
2026-07-02 19:55:40 +00:00
Eric Covener
6ff9dc2fdb Merge r1935005 from trunk:
merge_response_headers: fix lang iteration

reviewed by: covener, jfclere, jorton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1935006 13f79535-47bb-0310-9956-ffa450edef68
2026-06-05 10:05:36 +00:00
Eric Covener
0218d4b9c1 Merge r1933359 from trunk:
scan outgoing status line for newlines and controls



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1933360 13f79535-47bb-0310-9956-ffa450edef68
2026-04-26 16:32:29 +00:00
Ruediger Pluem
5b4ba1e8d5 Merge r1873397 from trunk:
PR62989: DOCTYPE tags in server-generated HTML.

Submitted By: Andra Farkas <deepbluemistake gmail.com>, Giovanni Bechis <giovanni paclan.it>
Reviewed by: rpluem, jorton, covener

Github: closes #553


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1929571 13f79535-47bb-0310-9956-ffa450edef68
2025-11-07 08:23:08 +00:00
Eric Covener
a7a9d814c7 fix header merging
Reviewed By: rpluem, jorton, ylavic



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1927039 13f79535-47bb-0310-9956-ffa450edef68
2025-07-07 11:59:38 +00:00
Eric Covener
5f82765bc6 Merge r1427465, r1918823 from trunk:
Remove support for Request-Range header sent by Navigator 2-3 and
MSIE 3


* Follow up to r1918814: Strings are from configuration and thus trusted

Submitted by: sf, rpluem
Reviewed by: rpluem, covener, jorton

Github: closes #475


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1920981 13f79535-47bb-0310-9956-ffa450edef68
2024-09-27 13:10:34 +00:00
Yann Ylavic
8ace8c7fc9 Merge r1918003, r1918022, r1918035, r1918078, r1918098, r1918099, r1918257, r1918482, r1918483, r1918491, r1919141, r1919148 from trunk
*) mod_http2: sync with module's github.
    - on newer HTTPD versions, return connection monitoring
      to the event MPM when block on client updates.
      2.4.x versions still treat connections in the event
      MPM as KeepAlive and purge them on load in the middle
      of response processing.
    - spelling fixes
    - support for yield calls in c2 "network" filter


 mpm_event,core: Handle async POLLIN/POLLOUT in CONN_STATE_PROCESS state.

* include/httpd.h:
  Rename CONN_STATE_CHECK_REQUEST_LINE_READABLE to CONN_STATE_KEEPALIVE
  and CONN_STATE_READ_REQUEST_LINE to CONN_STATE_PROCESS, keeping the
  old enums as aliases. Rework comments about each state.

* server/mpm/event/event.c:
  Use the new states names.
  Let the process_connection hooks return CONN_STATE_PROCESS for mpm_event
  to POLLIN or POLLOUT depending on c->cs->sense being CONN_SENSE_WANT_READ
  or CONN_SENSE_WANT_WRITE respectively.
  Remove (ab)use of CONN_STATE_WRITE_COMPLETION with CONN_SENSE_WANT_READ to
  mean poll() for read (and the need for the obscure c->clogging_input_filters
  to make it work as expected). This is what CONN_STATE_PROCESS is for now.
  Update the comment about the states that can be returned by process_connection
  hooks (and their usage).
  Use the same queue (process_q renamed from write_completion_q) for polling
  connections in both CONN_STATE_PROCESS and CONN_STATE_WRITE_COMPLETION
  states since they both use the same (server_rec's) Timeout. This implies
  that both states are accounted as "write-completion" in mod_status for now.

* server/mpm/motorz/motorz.c, server/mpm/simple/simple_io.c, modules/http/http_core.c:
  Use the new states names (only).

* include/scoreboard.h:
  Change comment about process_score->write_completion to note that the
  counter refers to CONN_STATE_PROCESS connections returned to the MPM
  too.

* modules/http2/h2_c1.c:
  Return the c1 connection with the CONN_STATE_PROCESS state rather than
  CONN_STATE_WRITE_COMPLETION when waiting for a window update (i.e. ask
  the MPM to poll for read directly). This avoids the transition to
  CONN_STATE_KEEPALIVE which could kill the connection under high load.


Github: closes #448


Follow up to r1918022: MMN minor bump and checks for the new conn_state_e aliases' usability.

mpm_event: Don't spam with "Stopping process due to MaxConnectionsPerChild"

When MaxConnectionsPerChild is reached there may be some connections to process
still and the listener should stop writing this at every loop. Logging once
is enough.

* server/mpm/event/event.c(check_infinite_requests): Raise conns_this_child
  unconditionally.
  

mpm_event, mod_status: Separate processing and write completion queues.

As a follow up to r1918022 which handled the new CONN_STATE_PROCESS(ing) and
existing CONN_STATE_WRITE_COMPLETION in the same async queue, let's now have
two separates ones which allows more relevant async accounting in mod_status.

Rename CONN_STATE_PROCESS to CONN_STATE_PROCESSING as it's how it will be
called in mod_status.

* include/ap_mmn.h:
  MMN minor bump for process_score->processing counter.

* include/httpd.h:
  Rename CONN_STATE_PROCESS to CONN_STATE_PROCESSING.

* include/scoreboard.h:
  Add process_score->processing field.

* include/httpd.h, modules/http/http_core.c, modules/http2/h2_c1.c,
    server/mpm/event/event.c, server/mpm/motorz/motorz.c,
    server/mpm/simple/simple_io.c:
  Rename CONN_STATE_PROCESS to CONN_STATE_PROCESSING.

* server/mpm/event/event.c:
  Restore write_completion_q to handle connections in CONN_STATE_WRITE_COMPLETION.
  Use processing_q (renamed from process_q) solely for CONN_STATE_PROCESSING.
  Update process_score->processing according to the length of processing_q.
  
* modules/generators/mod_status.c:
  Show the value of process_score->processing in the stats.


Follow up to r1918098 (and r1918022): Push missing changes.

mpm_event,mod_http2: Keep compatibility with CONN_STATE_PROCESSING + OK

Before r1918022, returning OK with CONN_STATE_PROCESSING to mpm_event was
handled like/by CONN_STATE_LINGER "to not break old or third-party modules
which might return OK w/o touching the state and expect lingering close,
like with worker or prefork MPMs".

So we need a new return code to be allowed to apply the new POLLIN/POLLOUT
behaviour for CONN_STATE_PROCESSING, thus revive AGAIN as introduced by
Graham some times ago for a nonblocking WIP (moved to a branch/PR since then).

MPM event will advertise its ability to handle CONN_STATE_PROCESSING + AGAIN
with AP_MPMQ_CAN_AGAIN, and mod_http2 can use that to know how to return to
the MPM as expected. When !AP_MPMQ_CAN_AGAIN modules/mod_http2 can still use
CONN_STATE_WRITE_COMPLETION + CONN_SENSE_WANT_READ + c->clogging_input_filters
which will work in mpm_even-2.4.x still.

* include/ap_mmn.h:
  Bump MMN minor for AP_MPMQ_CAN_AGAIN and AGAIN.

* include/ap_mpm.h:
  Define AP_MPMQ_CAN_AGAIN.

* include/httpd.h:
  Define AGAIN.

* modules/http2/h2.h:
  No need for H2_USE_STATE_PROCESSING anymore with AP_MPMQ_CAN_AGAIN.

* modules/http2/h2_c1.c:
  For !keepalive case return to the MPM using CONN_STATE_PROCESSING + AGAIN
  or CONN_STATE_WRITE_COMPLETION + c->clogging_input_filters depending on
  AP_MPMQ_CAN_AGAIN only.

* modules/http2/h2_session.c:
  Can return to the MPM for h2_send_flow_blocked() provided it's async only.

* server/mpm/event/event.c:
  Rework process_socket()'s CONN_STATE_PROCESSING to handle AGAIN and preserve
  compatibility. Have a lingering_close label to goto there faster when
  process_lingering_close() is to be called. Improve relevant comments.


mpm_event,mod_http2,mod_status: Follow up to r1918257: CONN_STATE_ASYNC_WAITIO.

Per discussion on PR #449, have a separate state for returning the connection
to the MPM to wait for an IO (namely CONN_STATE_ASYNC_WAITIO), rather than
(ab)using CONN_STATE_PROCESSING.

This removes the need for AGAIN added in r1918257 (for now), and AP_MPMQ_CAN_AGAIN
is renamed to AP_MPMQ_CAN_WAITIO.

This is also the state that mod_status accounts for, so rename ->processing
to ->wait_io in process_score (shows as "wait-io" in mod_status and mod_lua).


mpm_event: Follow up to r1918482: CONN_STATE_ASYNC_WAITIO > CONN_STATE_LINGER.


mpm_event: Follow up to r1918482: CONN_STATE_LINGER* are not the last anymore.

Since CONN_STATE_ASYNC_WAITIO, we cannot check for < or >= CONN_STATE_LINGER
anymore to determine if in an lingering close state, so let's add a new
CONN_STATE_IS_LINGERING_CLOSE() macro for this and use it in mpm_event.

The test for state == CONN_STATE_LINGER in process_lingering_close() is a
bit weak too in order to call ap_start_lingering_close() the first time only,
so have a conn_state->linger_started flag instead.


mod_status: Follow up to r1918482: Bump colspan for the new wait-io colomn


mod_status: "Threads" span three colomns (busy, graceful, idle), not two.


Submitted by: icing, ylavic, ylavic, ylavic, ylavic, ylavic, ylavic, ylavic, ylavic, ylavic, ylavic, ylavic
Reviewed by: ylavic, icing, gbechis
Github: closes #449


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1919548 13f79535-47bb-0310-9956-ffa450edef68
2024-07-27 14:18:49 +00:00
Eric Covener
a7d24b4ea9 Merge r1919247 from trunk:
copy the trusted flag from the subrequest

Submitted By: covener
Reviewed By: covener, ylavic, gbechis


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1919249 13f79535-47bb-0310-9956-ffa450edef68
2024-07-15 12:08:30 +00:00
Eric Covener
fe171ffdf8 Merge r1918795, r1918814 from trunk:
maintain trusted flag


* Always trust content types that we set literally

Submitted by: covener, rpluem
Reviewed by: covener, jorton, rpluem

Github: closes #459


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1918839 13f79535-47bb-0310-9956-ffa450edef68
2024-07-02 13:07:17 +00:00
Eric Covener
554554b0eb Merge r1918551 from trunk:
add ap_set_content_type_ex to differentiate

trusted sources



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1918560 13f79535-47bb-0310-9956-ffa450edef68
2024-06-24 17:54:34 +00:00
Eric Covener
ac20389f3c header validation after content-* are eval'ed
backport r1916770 from trunk
Submitted By: ylavic




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1916778 13f79535-47bb-0310-9956-ffa450edef68
2024-04-03 12:12:23 +00:00
Eric Covener
a29723ce1a let httpd handle CL/TE for non-http handlers
backport r1916769 from trunk:
Submitted By: ylavic, covener



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1916777 13f79535-47bb-0310-9956-ffa450edef68
2024-04-03 12:10:49 +00:00
Eric Covener
11d58d4a43 Merge r1907505, r1908186 from trunk:
* In the reverse proxy case r->filename might contain a query string if
  the nocanon option was used with ProxyPass.
  If this is the case cut off the query string as the last parameter in
  this query string might end up on an extension we take care about, but
  we only want to match against path components not against query
  parameters.


* Add CHANGES entry for r1907505 [skip ci]

Reviewed By: rpluem, ylavic, covener


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1908538 13f79535-47bb-0310-9956-ffa450edef68
2023-03-19 21:33:35 +00:00
Eric Covener
ce259c4061 Merge r1901497 from trunk:
use a liberal default limit for LimitRequestBody of 1GB


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1901499 13f79535-47bb-0310-9956-ffa450edef68
2022-06-01 12:31:48 +00:00
Jim Jagielski
5c66d1b981 Merge r1899451, r1899454, r1899562, r1899564, r1899584, r1899886 from trunk:
* Close the connection in case an EOC bucket was seen

* In case we see an EOC bucket and there was an error bucket before, use its
  status as status for the request. This should ensure proper status logging
  in the access log.


* We need to set r->status on each call after we noticed an EOC as
  data bucket generators like ap_die might have changed the status
  code. But we know better in this case and insist on the status
  code that we have seen in the error bucket.


* Keep track of the number of keepalives we processed on this connection.


* Report a broken backend in case reading the response line failed on the
  first request on this connection otherwise we assume we have just run
  into a keepalive race and the backend is still healthy.


* Add Changelog for r1899451, r1899454, r1899562, r1899564, r1899584

Submitted by: rpluem
Reviewed by: jim

Github: closes #314


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1900755 13f79535-47bb-0310-9956-ffa450edef68
2022-05-09 18:02:07 +00:00
Yann Ylavic
19aa2d83b3 core: Simpler connection close logic if discarding the request body fails.
If ap_discard_request_body() sets AP_CONN_CLOSE by itself it simplifies and
allows to consolidate end_output_stream() and error_output_stream().


Merge r1898683 from trunk.
Submitted by: ylavic, rpluem
Reviewed by: ylavic, rpluem, covener


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1898692 13f79535-47bb-0310-9956-ffa450edef68
2022-03-07 14:46:08 +00:00
Yann Ylavic
a962ba7304 Merge r1895914, r1895921 from trunk:
*) http: Enforce that fully qualified uri-paths not to be forward-proxied
     have an http(s) scheme, and that the ones to be forward proxied have a
     hostname, per HTTP specifications.
     trunk patch: http://svn.apache.org/r1895914
                  http://svn.apache.org/r1895921
     2.4.x patch: https://patch-diff.githubusercontent.com/raw/apache/httpd/pull/286.patch
     backport PR: https://github.com/apache/httpd/pull/286
     +1: ylavic, minfrin, gbechis


mod_proxy: Detect unix: scheme syntax errors at load time.

* modules/proxy/mod_proxy.c(add_pass, add_member, set_proxy_param,
                            proxysection):
  Check return value of ap_proxy_de_socketfy().

* modules/proxy/proxy_util.c(ap_proxy_get_worker_ex):
  Check return value of ap_proxy_de_socketfy().



http: Enforce that fully qualified uri-paths not to be forward-proxied
      have an http(s) scheme, and that the ones to be forward proxied have a
      hostname, per HTTP specifications.

The early checks avoid failing the request later on and thus save cycles
for those invalid cases.


Submitted by: ylavic
Reviewed by: ylavic, minfrin, gbechis
Closes #286


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1895955 13f79535-47bb-0310-9956-ffa450edef68
2021-12-14 15:35:56 +00:00
Stefan Eissing
fec401af34 Merge r1895719 from trunk:
*) mod_http: Correctly sent a 100 Continue status code when sending an interim
     response as result of an Expect: 100-Continue in the request and not the
     current status code of the request. PR 65725 [Ruediger Pluem]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1895897 13f79535-47bb-0310-9956-ffa450edef68
2021-12-13 15:16:55 +00:00
Graham Leggett
c795f1c736 Backport:
*) Easy patches: synch 2.4.x and trunk
         - mod_auth_basic: Use ap_cstr_casecmp instead of strcasecmp.
         - mod_ldap: log and abort locking errors.
         - mod_ldap: style fix for r1831165
         - mod_ldap: build break fix for r1831165
      --> These 3 commits are preparation work for backporting r1856735
         - mod_deflate: Avoid hard-coded "%ld" format strings in mod_deflate's logging statements
         - mod_deflate: Use apr_uint64_t instead of uint64_t (follow up to r1849590)
         - mod_forensic: Follow up to r1856490: missing one mod_log_forensic test_char_table case.
                         (r1856490 has been backported in r1870261)
         - mod_rewrite: Save a few cycles.
         - mod_request: Fix a comment (missing '_' in 'keep_body') and some style issues
         - core: remove extra whitespace in HTTP_NOT_IMPLEMENTED
     trunk patch:
          https://svn.apache.org/r1817063
          https://svn.apache.org/r1831165
          https://svn.apache.org/r1831171
          https://svn.apache.org/r1831172
          https://svn.apache.org/r1849590
          https://svn.apache.org/r1849630
          https://svn.apache.org/r1856491
          https://svn.apache.org/r1883421
          https://svn.apache.org/r1889327
          https://svn.apache.org/r1891200
     2.4.x patch: svn merge -c 1817063,1831165,1831171,1831172,1849590,1849630,1856491,1883421,1889327,1891200 ^/httpd/httpd/trunk .
     +1: jailletc36, covener, jim
     icing: I have trouble running the svn merge due to conflicts in CHANGES and
            the infamous log tags. Do you have a patch or a PR to use for checking?
     covener: on faith



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1892510 13f79535-47bb-0310-9956-ffa450edef68
2021-08-21 21:30:47 +00:00
Ruediger Pluem
bf463edd81 Merge r1889341 from trunk:
* Do not strip any headers from 304 responses.

PR: 61820

Reviewed by: rpluem, covener, ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1889764 13f79535-47bb-0310-9956-ffa450edef68
2021-05-11 15:21:43 +00:00
Christophe Jaillet
9a7bbd69f2 Merge r1887999 from trunk
* modules/http/http_core.c server/protocol.c:
     Make sure that conn->keepalive is NOT reset after being set in ap_read_request()

Submitted by: jfclere
Reviewed by: jfclere, covener, ylavic
Backported by: jailletc36

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1888926 13f79535-47bb-0310-9956-ffa450edef68
2021-04-18 19:09:03 +00:00
Yann Ylavic
56e910ce9c Fix APLOGNO(10258) missing from r1887384.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1887390 13f79535-47bb-0310-9956-ffa450edef68
2021-03-09 18:15:22 +00:00
Yann Ylavic
1d65a704e0 Merge r1879285, r1879322, r1879345, r1879346, r1879465, r1879469, r1879470, r1879488, r1879541, r1879548 from trunk:
"[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.


Be defensive when the request is missing.


Remove tabs.


Use a dedicated constant for the base64 sha1 length.


Be defensive when calculating the digest. Make sure the offset is initialised
to zero before reading the current offset.


Seek to the start of the file when calculating the ETag.


Add log numbers to util_etag.c.


Add MMAP support to ETag generation.


Use a brigade instead of direct reads, allow APR to handle MMAP.


Bump the logno.


Submitted by: minfrin
Reviewed by: minfrin, jim, ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1887384 13f79535-47bb-0310-9956-ffa450edef68
2021-03-09 16:28:23 +00:00
Christophe Jaillet
5ace948f42 Merge most of r1747469 from trunk
* When ap_cstr_casecmp[n] have been introduced, in r1747469, it has 
         introduced many differences between 2.4.x and trunk.
         Direct backporting was not that easy because:
            - it was initialy introduced as ap_casecmpstr[n] with several patches
            - it touched some files that were not in 2.4.x branch
         Later, parts of it have already been backported.

         This patch tries to clean all this.

Submitted by: many people
Reviewed by: jailletc36, minfrin, ylavic
Backported by: jailletc36

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1885697 13f79535-47bb-0310-9956-ffa450edef68
2021-01-19 19:29:43 +00:00
Graham Leggett
97597452bb Backport to 2.4:
*) mod_proxy_http: Fix 100-continue deadlock for spooled request bodies. BZ 63855.
     trunk patch: https://svn.apache.org/r1769760
                  https://svn.apache.org/r1770220
                  https://svn.apache.org/r1868576
                  https://svn.apache.org/r1868653
                  https://svn.apache.org/r1883639
                  https://svn.apache.org/r1883640
                  https://svn.apache.org/r1884218
                  https://svn.apache.org/r1884220
     2.4.x patch: http://people.apache.org/~ylavic/patches/2.4.x-bz63855-1on5.patch
                  https://github.com/apache/httpd/pull/154
     +1: ylavic, covener, minfrin



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1885571 13f79535-47bb-0310-9956-ffa450edef68
2021-01-16 13:49:50 +00:00
Graham Leggett
2d0e7dc565 Backport to 2.4:
*) core: Correctly strip unwanted headers on 304 response
     Trunk version of patch:
        http://svn.apache.org/r1881590
        http://svn.apache.org/r1881624
     +1: ylavic, covener, minfrin



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1885569 13f79535-47bb-0310-9956-ffa450edef68
2021-01-16 13:27:39 +00:00
Graham Leggett
3303dc4f72 *) strict content-length parsing
trunk patch http://svn.apache.org/r1877954
                 http://svn.apache.org/r1877955
                 http://svn.apache.org/r1879369
                 http://svn.apache.org/r1879373
     2.4.x patch: http://people.apache.org/~ylavic/patches/httpd-2.4.x-ap_parse_strict_length.patch
    +1: ylavic, minfrin, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1879639 13f79535-47bb-0310-9956-ffa450edef68
2020-07-08 11:09:13 +00:00
Yann Ylavic
5002dde60a Merge r1873985 from trunk:
Fix spelling errors found by codespell.  [skip ci]

Submitted by: mrumph
Reviewed by: mrumph, jim, ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1874286 13f79535-47bb-0310-9956-ffa450edef68
2020-02-21 00:33:40 +00:00
Jim Jagielski
0bca294f9d Merge r1873748 from trunk:
factor out TE=chunked checking


Submitted by: covener
Reviewed by: covener, minfrin, jorton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1873906 13f79535-47bb-0310-9956-ffa450edef68
2020-02-11 13:19:05 +00:00
Graham Leggett
4e9b708324 Backport r1765061
ap_check_pipeline: clarify/simplify !max_blank_lines logic, no functional change.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1872228 13f79535-47bb-0310-9956-ffa450edef68
2020-01-01 23:14:08 +00:00
Stefan Eissing
4f5e307d7c Merge of r1864191 from trunk:
*) core, proxy: remove request URL and headers from error docs (CVE-2019-10092)
     [Eric Covener]




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1864207 13f79535-47bb-0310-9956-ffa450edef68
2019-08-02 09:10:06 +00:00
Graham Leggett
1efc485fd9 Easy patches: synch 2.4.x and trunk
- core: 80 chars
   - http_core: Clean-uo and style. No functional change overall
   - http_core: One more style fix in ap_process_http_async_connection()
   - mod_mime: Fix a cppcheck warning
   - mod_proxy_ajp: Fix a harmless clang warning
   - suexec: avoid a potential sprintf overflow
   - mod_headers: This is harmless, but this really should be an 'echo_do *'
   - core: Fix typo
   - core: Update a comment about the 'PATCH' HTTP command
   - mod_proxy_balancer: Fix some HTML syntax issues
trunk patch:
   - http://svn.apache.org/r1780282
   - http://svn.apache.org/r1814659
   - http://svn.apache.org/r1814660
   - http://svn.apache.org/r1838285
   - http://svn.apache.org/r1842881
   - http://svn.apache.org/r1846253
   - http://svn.apache.org/r1853757
   - http://svn.apache.org/r1851702
   - http://svn.apache.org/r1853980
   - http://svn.apache.org/r1855614
2.4.x patch: svn merge -c 1780282,1814659,1814660,1838285,1842881,1846253,1853757,1851702,1853980,1855614 ^/httpd/httpd/trunk .
+1: jailletc36, jim, rjung


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1860129 13f79535-47bb-0310-9956-ffa450edef68
2019-05-27 12:37:34 +00:00
Graham Leggett
110524c95e mod_status: PR60647: ACC per connection not available w/ event MPM
trunk patch: http://svn.apache.org/r1780280
2.4.x patch: svn merge -c 1780280 ^/httpd/httpd/trunk .
              (minus CHANGES and ap_mmn.h)
+1: jailletc36, jim, rjung


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1860128 13f79535-47bb-0310-9956-ffa450edef68
2019-05-27 12:31:24 +00:00
Stefan Eissing
9a295fb59b Merge of r1854004 from trunk:
*) http: Fix possible empty response with mod_ratelimit for HEAD requests.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1855391 13f79535-47bb-0310-9956-ffa450edef68
2019-03-13 10:09:08 +00:00
Jim Jagielski
5160dc0d5d Merge r1749402, r1656549, r1840776, r1800126, r1817131, r1834226 from trunk:
Style only

Be more consistent:
   - add space between (if|while) and \(
   - place of 'break ' statement

Fix cut and paste typo in error message + remove empty lines to be consistent

follow-up to r1656549.

Instead of logging a password (which is not a good practice), clarify the associated message

* Silence compiler warning

Be less tolerant when parsing the credencial for Basic authorization. Only spaces  should be accepted after the authorization scheme. \t are also tolerated.

The current code accepts \v and \f as well.

The same behavior is already used in 'ap_get_basic_auth_pw()' which is mostly the same function as 'get_basic_auth()'.

Function used as 'apr_reslist_destructor' when calling 'apr_reslist_create()' should have the following prototype:

apr_status_t (*apr_reslist_destructor)(void *resource, void *params, apr_pool_t *pool);
Submitted by: jailletc36, rpluem, jailletc36, jailletc36
Reviewed by: jailletc36, minfrin, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1841329 13f79535-47bb-0310-9956-ffa450edef68
2018-09-19 12:54:51 +00:00
Stefan Eissing
c6211c00d4 Merge r1837056 from trunk:
*) http: Enforce consistently no response body with both 204 and 304
     statuses.  [Yann Ylavic]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1840572 13f79535-47bb-0310-9956-ffa450edef68
2018-09-11 14:04:53 +00:00
Yann Ylavic
831ef7623e Merge r1837130 from trunk:
mod_ratelimit: Don't interfere with "chunked" encoding.

By the time ap_http_header_filter() sends the header brigade and adds the
"CHUNK" filter, we need to garantee that the header went through all the
filters' stack, and more specifically above ap_http_chunk_filter() which
assumes that all it receives is content data.
Since rate_limit_filter() may retain the header brigade, make it run after
ap_http_chunk_filter(), just before AP_FTYPE_CONNECTION filters.

Also, ap_http_header_filter() shouldn't eat the EOS for HEAD/no-body responses.
For instance mod_ratelimit depends on it since r1835168, but any next request
filter may as well to flush and/or bail out approprietely.

This fixes the regression introduced in 2.4.34 (r1835168).
PR 62568.

Submitted by: ylavic
Reviewed by: covener, ylavic, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1839497 13f79535-47bb-0310-9956-ffa450edef68
2018-08-28 20:07:07 +00:00
Jim Jagielski
5d779df4e2 Merge r1833014 from trunk:
* modules/http/http_request.c (ap_process_request_after_handler,
  ap_process_request): Cache and retrieve the brigade structure used
  to send EOR and FLUSH between requests in c->pool userdata, to avoid
  allocating a brigade structure per-request out of c->pool.

Submitted by: rpluem, jorton

Submitted by: jorton
Reviewed by: jorton, covener, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1833841 13f79535-47bb-0310-9956-ffa450edef68
2018-06-19 13:15:49 +00:00
Jim Jagielski
8c4cf9f5a7 Merge r1828920 from trunk:
PR62186: preserve %<m for ErrorDocument internal redirects

  *) core: Preserve the original HTTP request method in the '%<m' LogFormat
     when an path-based ErrorDocument is used.  PR 62186.
     [Micha Lenk <micha lenk.info>]

Submitted By: Micha Lenk
Committed By: covener

Submitted by: covener
Reviewed by: covener, jhriggs, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1830248 13f79535-47bb-0310-9956-ffa450edef68
2018-04-26 17:35:44 +00:00
Yann Ylavic
c2041de696 Merge r1826556, r1826847 from trunk:
Fix timeout logging in ap_process_request().

We can't use 'r' after ap_process_request_after_handler(), the core output
filter might have cleaned up its deferred bucket brigade on error, including
the EOR bucket.

Reported by: steffenal
Closes SpiderLabs/ModSecurity#1542


Follow up to r1826556: CHANGES entry.


Submitted by: ylavic
Reviewed by: ylavic, covener, rjung


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1826899 13f79535-47bb-0310-9956-ffa450edef68
2018-03-15 23:19:12 +00:00
Yann Ylavic
acf49a7ea6 Revert r1826543, was meant for trunk...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1826555 13f79535-47bb-0310-9956-ffa450edef68
2018-03-12 15:19:07 +00:00
Yann Ylavic
9627882d3b Fix timeout logging in ap_process_request().
We can't use 'r' after ap_process_request_after_handler(), the core output
filter might have cleaned up its deferred bucket brigade on error, including
the EOR bucket.

Reported by: steffenal
Fixes SpiderLabs/ModSecurity#1542

[Reverted by r1826555]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1826543 13f79535-47bb-0310-9956-ffa450edef68
2018-03-12 12:24:27 +00:00
Graham Leggett
223df5cf69 mod_proxy, mod_ssl: Handle SSLProxy* directives in <Proxy> sections,
allowing per backend TLS configuration.
trunk patch: http://svn.apache.org/r1740928
             http://svn.apache.org/r1740960
             http://svn.apache.org/r1740967
             http://svn.apache.org/r1740987
             http://svn.apache.org/r1740998
             http://svn.apache.org/r1742697
             http://svn.apache.org/r1756976
             http://svn.apache.org/r1781313
             http://svn.apache.org/r1812193
2.4.x patch: https://svn.apache.org/repos/asf/httpd/httpd/patches/2.4.x/httpd-2.4.x-r1740928_and_co-v6.patch
+1: ylavic, icing, minfrin


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1824187 13f79535-47bb-0310-9956-ffa450edef68
2018-02-13 23:43:36 +00:00
Jim Jagielski
6557d718a6 Merge r1811744 from trunk:
core, mod_rewrite: introduce the 'redirect-keeps-vary' note
                   to allow proper Vary header insertion when
                   dealing with a RewriteRule in a directory
                   context.

This change is an attempt to fix a long standing problem,
brought up while working on PR 58231. Our documentation clearly
states the following:

"If a HTTP header is used in a condition this header is added
to the Vary header of the response in case the condition
evaluates to true for the request."

This is currently not true for RewriteCond/Rules working in
a directory context, since when an internal redirect happens
all the outstanding response headers get dropped.

There might be a better solution so I am looking forward to
hear more opinions and comments. My goal for a delicate change
like this one would be to affect the least amount of configurations
possible, without triggering unwanted side effects.

If the solution is good for everybody tests will be written
in the suite asap.


Submitted by: elukey
Reviewed by: elukey, icing, ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1815100 13f79535-47bb-0310-9956-ffa450edef68
2017-11-13 13:31:33 +00:00
Jim Jagielski
c465a8137d Merge r1799784, r1799786 from trunk:
Since r1753257, "HEAD" method is registered into the registry hash with the M_GET ID.
(r1757672 in 2.4.x)

We iterate over all the values of the registery, so there is no need anymore to have a special case for "HEAD" in  'make_allow()'. It has its own entry now.

With the current code, we have "HEAD" 3 times in the Allow Header field.
This is because we find M_GET 2 times in the registry hash. The first one gives "GET" and "HEAD" (as the special handling), and the second "HEAD" and "HEAD" (as the special handling).


BTW, use APR_ARRAY_PUSH instead of hand coding it, in oder to have the code more readable.

PR 61207

Add  CHANGE entry
Submitted by: jailletc36
Reviewed by: jailletc36, rpluem, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1799890 13f79535-47bb-0310-9956-ffa450edef68
2017-06-26 12:20:14 +00:00
Eric Covener
d98d3a43c6 SECURITY: CVE-2017-7679 (cve.mitre.org)
mod_mime can read one byte past the end of a buffer when sending a
malicious Content-Type response header.

Merge 1797550 from trunk:
mod_mime: fix quoted pair scanning

Submitted By: ylavic
Reviewed By: covener, ylavic, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1797653 13f79535-47bb-0310-9956-ffa450edef68
2017-06-05 12:12:31 +00:00
Jim Jagielski
7fa0ad4503 Merge r1777460, r1777672 from trunk:
http: allow folding in check_headers(), still compliant with RFC 7230 (3.2.4).


http: follow up to r1777460.
We MUST unfold outgoing HTTP headers in any case, "message/http" is for
inner content.
Submitted by: ylavic
Reviewed by: ylavic, covener, wrowe


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1778052 13f79535-47bb-0310-9956-ffa450edef68
2017-01-09 21:17:08 +00:00
Jim Jagielski
313470540f Merge r1775195 from trunk:
http_header_filter: on check_headers() failure, use AP_FILTER_ERROR and EOC
semantics to respectively warn the caller and cleanly terminate the connection
afterwards.

Suggested by: rpluem


Submitted by: ylavic
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1775828 13f79535-47bb-0310-9956-ffa450edef68
2016-12-23 12:34:47 +00:00