summaryrefslogtreecommitdiffstats
path: root/modules/mappers (follow)
Commit message (Collapse)AuthorAgeFilesLines
* * Leave the proper escaping of the URL and the adding of r->args to theRuediger Pluem2024-09-111-19/+10
| | | | | | | | | proxy module which runs after us after r1920570. Just take care to add r->args in case the proxy rule has the [NE] flag set and tell the proxy module to not escape in this case. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1920571 13f79535-47bb-0310-9956-ffa450edef68
* mod_rewrite, mod_proxy: mod_proxy to cononicalize rewritten [P] URLs. PR 69235.Yann Ylavic2024-09-111-7/+6
| | | | | | | | | | | | | When mod_rewrite sets a "proxy:" URL with [P], it should be canonicalized by mod_proxy still, notably to handle any "unix:" local socket part. To avoid double encoding in perdir context, a follow up commit should remove the ap_escape_uri() done in mod_rewrite since it's now on mod_proxy to canonicalize, per PR 69260. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1920570 13f79535-47bb-0310-9956-ffa450edef68
* mod_rewrite: Follow up to r1919325: Simplify QSLAST tracking.Yann Ylavic2024-09-111-18/+14
| | | | | | | | We don't need to loop to skip the safe qmarks (thanks rpluem!). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1920566 13f79535-47bb-0310-9956-ffa450edef68
* don't merge slashes on perdir prefixEric Covener2024-08-131-1/+4
| | | | | | | | | Submitted by: Eric Covener Github: closes #472 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1919860 13f79535-47bb-0310-9956-ffa450edef68
* mod_rewrite: Better question mark tracking to avoid UnsafeAllow3F. PR 69197.Yann Ylavic2024-07-171-18/+90
| | | | | | | | | | | | | Track in do_expand() whether a '?' in the uri-path comes from a literal in the substitution string or from an expansion (variable, lookup, ...). In the former case it's safe to assume that it's the query-string separator but for the other case it's not (could be a decoded %3f from r->uri). This allows to avoid [UnsafeAllow3F] for most cases. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1919325 13f79535-47bb-0310-9956-ffa450edef68
* merge leading slashes by defaultEric Covener2024-07-151-0/+14
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1919246 13f79535-47bb-0310-9956-ffa450edef68
* * Always trust content types that we set literallyRuediger Pluem2024-07-021-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918814 13f79535-47bb-0310-9956-ffa450edef68
* match AP_IS_SLASH macroEric Covener2024-06-261-1/+1
| | | | | | | followup to 1918651 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918663 13f79535-47bb-0310-9956-ffa450edef68
* don't add / to / in the non-perdirEric Covener2024-06-261-8/+4
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918652 13f79535-47bb-0310-9956-ffa450edef68
* factor out IS_SLASH, perdir fixEric Covener2024-06-261-8/+10
| | | | | | | in per-dir, the filename will be internally redirected, so / is OK too. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918651 13f79535-47bb-0310-9956-ffa450edef68
* fix comparison of local path on WindowsEric Covener2024-06-251-1/+16
| | | | | | | Submitted By: Yann Ylavic git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918623 13f79535-47bb-0310-9956-ffa450edef68
* * modules/mappers/mod_rewrite.c: Fill in logno.Joe Orton2024-06-251-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918604 13f79535-47bb-0310-9956-ffa450edef68
* block inadvertent subst of special filenamesEric Covener2024-06-241-12/+26
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918553 13f79535-47bb-0310-9956-ffa450edef68
* tighten up prefix_stat and %3f handlingEric Covener2024-06-241-28/+123
| | | | | | | Require opt-ins for unsafe substitutions git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918552 13f79535-47bb-0310-9956-ffa450edef68
* add ap_set_content_type_ex to differentiateEric Covener2024-06-243-7/+9
| | | | | | | trusted sources git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918551 13f79535-47bb-0310-9956-ffa450edef68
* mod_rewrite: disambiguate select_random_value_part().Yann Ylavic2024-03-141-11/+8
| | | | | | | | | | | | | | | | gcc-13's -fsanitize=undefined finds: mod_rewrite.c|1702 col 37| error: '%s' directive argument is null [-Werror=format-overflow=] || 1701 | value = select_random_value_part(r, value); || 1702 | rewritelog((r, 5, NULL, "randomly chosen the subvalue `%s'",value)); || | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ because it's not clear from select_random_value_part() whether it can return NULL or not. Rewrite the function so that it's clearer/simpler. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1916298 13f79535-47bb-0310-9956-ffa450edef68
* mod_alias: Add AliasPreservePath directive to map the fullGraham Leggett2023-07-171-1/+12
| | | | | | | path after the alias in a location. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1911067 13f79535-47bb-0310-9956-ffa450edef68
* mod_rewrite: Fix a possible NULL pointer dereference in hook_uri2fileJoe Orton2023-07-061-1/+1
| | | | | | | | | | | is_absolute_uri() dereferences r->filename in the function body, but there is no check if r->filename == NULL before. Submitted by: Luboš Uhliarik <luhliari redhat.com> Github: closes #355 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910815 13f79535-47bb-0310-9956-ffa450edef68
* typos/whitespaceEric Covener2023-06-301-4/+4
| | | | | | | | | what's one more rev? [skip ci] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910705 13f79535-47bb-0310-9956-ffa450edef68
* incorporate feedback from rpluemEric Covener2023-06-281-6/+9
| | | | | | | | | update comments, reverse check, force QSL [skip ci] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910666 13f79535-47bb-0310-9956-ffa450edef68
* back to original patch in PR66672Eric Covener2023-06-281-3/+5
| | | | | | | Since QSNONE will skip splitoutqueryargs, it's where we should fixup the trailing ? git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910662 13f79535-47bb-0310-9956-ffa450edef68
* revert recent r1910650Eric Covener2023-06-281-8/+10
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910661 13f79535-47bb-0310-9956-ffa450edef68
* act more like pre-r1908097 with rewriteEric Covener2023-06-281-10/+8
| | | | | | | | | - be more conservative with setting QSNONE - allow the query to be split as historically, but then drop r->args if QSNONE git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910650 13f79535-47bb-0310-9956-ffa450edef68
* PR66672: rewrite QSA+trailing ? regressionEric Covener2023-06-271-2/+5
| | | | | | | | | | | mod_rewrite: Fix a recent regression where a rule with both a trailing '?' and the [QSA] flag did not have the query appended. PR66672 Submitted By: Frank Meier <frank.meier ergon.ch> git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910633 13f79535-47bb-0310-9956-ffa450edef68
* * Add server directory to include path as mod_rewrite requires test_char.h.Ruediger Pluem2023-04-191-0/+5
| | | | | | | | | PR: 66571 Submitted by: Valeria Petrov <valeria.petrov@spinetix.com> Reviewed by: rpluem git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1909241 13f79535-47bb-0310-9956-ffa450edef68
* mod_alias: When an alias is declared inside a Location, make sureGraham Leggett2023-04-141-0/+16
| | | | | | | | | the balance of the URL is preserved to match the alias declared outside a location. Fixes an error where all requests are mapped to the root of the location. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1909137 13f79535-47bb-0310-9956-ffa450edef68
* fix regression in 2.4.56Eric Covener2023-03-301-0/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908813 13f79535-47bb-0310-9956-ffa450edef68
* mod_rewrite: Follow up to r1908347: Use [B, BNE=...] rather than [B=...,BNEG].Yann Ylavic2023-03-131-11/+23
| | | | | | | | Replaces BNEG with BNE= for a more flexible syntax. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908359 13f79535-47bb-0310-9956-ffa450edef68
* mod_rewrite: New BNEG flag to negate B=, BCTLS and B= not mutually exclusive.Yann Ylavic2023-03-131-33/+16
| | | | | | | | | | * modules/mappers/mod_rewrite.c(escape_backref): Handle [B=...,BNEG] to encode anthing not in B=, and [B=...,BCTLS] to encode both controls/space characters and anything set in B=. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908347 13f79535-47bb-0310-9956-ffa450edef68
* add [BCTLS] alternative to [B] for 2.4.56 problemsEric Covener2023-03-111-7/+24
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908301 13f79535-47bb-0310-9956-ffa450edef68
* followup to r1908296: only for redirectsEric Covener2023-03-111-2/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908299 13f79535-47bb-0310-9956-ffa450edef68
* allow decoded chars when they will be escapedEric Covener2023-03-111-18/+27
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908296 13f79535-47bb-0310-9956-ffa450edef68
* avoid delimiting the query with a backreferenceEric Covener2023-03-051-13/+33
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908097 13f79535-47bb-0310-9956-ffa450edef68
* don't forward invalid query stringsEric Covener2023-03-051-0/+22
| | | | | | | Submitted by: rpluem git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908095 13f79535-47bb-0310-9956-ffa450edef68
* mod_rewrite: URI-to-filename rewrites to transparently handle proxy mappings.Yann Ylavic2022-03-011-8/+30
| | | | | | | | | | | | | | | | | | | | Since mod_rewrite works on r->filename and mod_proxy's mapping=servlet|decoded sets its "proxy:" URL there at pre_translate_name stage (i.e. before mod_rewrite's translate_name hook), users have to match the full proxy URL in their RewriteRules to handle proxy mappings, which is not very friendly nor consistent with how proxy non-mapping requests have to be matched. Let's use r->filename = r->uri in hook_uri2file() for pre_trans'ed reverse proxy requests, and restore r->filename to its original value if the request was finally DECLINED (like in hook_fixup). But if a proxy mapping gets rewritten to a non-proxy request, clear any proxy specific r->proxyreq or r->handler so that processing continues accordingly. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898509 13f79535-47bb-0310-9956-ffa450edef68
* followup to r1894456: use a DirectorySlash argument insteadEric Covener2021-10-221-22/+28
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1894460 13f79535-47bb-0310-9956-ffa450edef68
* add DirectorySlashNotFound to silence scannersEric Covener2021-10-211-0/+17
| | | | | | | | Almost as awkwardly named as IndexForbiddenReturn404 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1894456 13f79535-47bb-0310-9956-ffa450edef68
* * Good catch by Yann: This is dead codeRuediger Pluem2021-10-081-3/+0
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1894034 13f79535-47bb-0310-9956-ffa450edef68
* * Make aliases more robust against potential traversal attacks, by usingRuediger Pluem2021-10-081-6/+42
| | | | | | | | | apr_filepath_merge to merge the real path and the remainder of the fake path like we do in the same situation for resources mapped by DocumentRoot. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1894024 13f79535-47bb-0310-9956-ffa450edef68
* mod_rewrite: Follow up to r1893519: Handle potential "unix://[authority]/".Yann Ylavic2021-09-231-1/+1
| | | | | | | | is_absolute_uri() should return the offset to the authority part, if any. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893532 13f79535-47bb-0310-9956-ffa450edef68
* mod_rewrite: Fix UDS ("unix:") scheme for [P] rules. PR 57691 + 65590.Yann Ylavic2021-09-221-0/+7
| | | | | | | | | | | | | | | | Handle the unix: scheme as an obsolute URI or a rule like: RewriteRule ^/(.*) unix:/path/to/uds.sock|fcgi://localhost/$1 [P] sets r->filename for /index.html as: proxy:http://www.example.com/unix:/path/to/uds.sock|http://localhost/index.html instead of the expected: proxy:unix:/path/to/uds.sock|http://localhost/index.html Submitted by: Janne Peltonen <janne.peltonen sange.fi> Reviewed by: ylavic git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893516 13f79535-47bb-0310-9956-ffa450edef68
* Add log tags.Graham Leggett2021-06-241-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1891023 13f79535-47bb-0310-9956-ffa450edef68
* dbm: Split the loading of a dbm driver from the opening of a dbm file. WhenGraham Leggett2021-06-241-0/+26
| | | | | | | | an attempt to load a dbm driver fails, log clearly which driver triggered the error (not "default"), and what the error was. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1891019 13f79535-47bb-0310-9956-ffa450edef68
* *) core: provide ap_ssl_* functions in new http_ssl.h header file.Stefan Eissing2021-03-261-0/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1888083 13f79535-47bb-0310-9956-ffa450edef68
* Using the new ap_ssl_conn_is_ssl() and ap_ssl_var_lookup() in all internal ↵Stefan Eissing2021-03-091-10/+3
| | | | | | | | | | | | modules. * leaving mod_nw_ssl and mod_ssl itself untouched * removing mod_ssl.h includes where no longer necessary * some modules might skip post_config hooks, but those were left in, even when empty now. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1887364 13f79535-47bb-0310-9956-ffa450edef68
* * modules/mappers/mod_rewrite.c: Remove unused MAX_COOKIE_LEN.Joe Orton2020-12-161-4/+0
| | | | | | | | Submitted by: Bryan Heden <b.heden gmail.com> Github: closes #147 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1884510 13f79535-47bb-0310-9956-ffa450edef68
* Save a few cycles.Christophe Jaillet2020-11-141-6/+4
| | | | | | | 'is_absolute_uri()' returns the length of the prefix, so there is no need to scan these bytes when looking for a '?' character git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1883421 13f79535-47bb-0310-9956-ffa450edef68
* Fix a few warnings on 64 bits windows compilationChristophe Jaillet2020-08-291-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1881306 13f79535-47bb-0310-9956-ffa450edef68
* samesite: fix check for 0, add "false" alternative.Eric Covener2020-08-281-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1881263 13f79535-47bb-0310-9956-ffa450edef68
* core,modules: provide/use ap_parse_strict_length() helper.Yann Ylavic2020-05-201-5/+3
| | | | | | | | | It helps simplifying a lot of duplicated code based on apr_strtoff(), while also rejecting leading plus/minus signs which are dissalowed in Content-Length and (Content-)Range headers. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1877954 13f79535-47bb-0310-9956-ffa450edef68