summaryrefslogtreecommitdiff
path: root/modules/mappers
Commit message (Collapse)AuthorAgeFilesLines
* * 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
* Add missing pool tags to help debugging.Yann Ylavic2020-04-162-0/+4
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1876599 13f79535-47bb-0310-9956-ffa450edef68
* remove unused headersGiovanni Bechis2020-03-091-11/+0
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1874997 13f79535-47bb-0310-9956-ffa450edef68
* Fix spelling errors found by codespell. [skip ci]Mike Rumph2020-02-131-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1873985 13f79535-47bb-0310-9956-ffa450edef68
* add SameSite to RewriteRule ... ... [CO]Eric Covener2020-02-081-0/+7
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1873762 13f79535-47bb-0310-9956-ffa450edef68
* PR62989: DOCTYPE tags in server-generated HTML. Eric Covener2020-01-311-1/+1
| | | | | | | | | Submitted By: Andra Farkas <deepbluemistake gmail.com>, Giovanni Bechis <giovanni paclan.it> git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1873397 13f79535-47bb-0310-9956-ffa450edef68
* * modules/mappers/mod_rewrite.c: Enhance trace-level logging to logJoe Orton2019-09-131-166/+205
| | | | | | | | | | | | | line numbers accurately for C99 compilers, and remove odd/awkward double-parentheses using the rewritelog() macro. For non-C99 compilers do_rewritelog() will now be defined - but as a noop - if REWRITELOG_DISABLED is defined at compile time. No functional change at runtime apart from the line numbers being fixed. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1866894 13f79535-47bb-0310-9956-ffa450edef68
* followup to r1861542: return early from error pathEric Covener2019-06-181-2/+2
| | | | | | | | avoid setting a location: header of a non-URL 500 error path git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1861569 13f79535-47bb-0310-9956-ffa450edef68
* add RedirectRelative directive to allow relative Redirect targetsEric Covener2019-06-171-47/+61
| | | | | | | | | | | | | 2616 forbade relative redirect URLs, but 7231 allows them Early 2.2 maintenance levels did not fix them up, but later 2.2 and all 2.4 fixed them up with ap_construct_url(). Allow opt-in to not fixing up relative URLs with RedirectRelative git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1861542 13f79535-47bb-0310-9956-ffa450edef68
* style: cmd_rec at the bottomEric Covener2019-06-171-27/+28
| | | | | | | no functional change git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1861528 13f79535-47bb-0310-9956-ffa450edef68
* LanguagePriority should be case-insensitive in order to match AddLanguage ↵Christophe Jaillet2019-01-101-1/+1
| | | | | | | | behavior. PR 39730 Test case added in r1850983 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1850989 13f79535-47bb-0310-9956-ffa450edef68
* Retsore 2.4.x default behavior modified in r1557580.Christophe Jaillet2018-10-221-1/+1
| | | | | | | | Update doc accordingly. Slightly tweak mod_speling doc git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1844598 13f79535-47bb-0310-9956-ffa450edef68
* * modules/mappers/mod_negotiation.c (set_language_quality): RemoveJoe Orton2018-10-051-3/+0
| | | | | | | redundant branch (warning from Coverity). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1842884 13f79535-47bb-0310-9956-ffa450edef68
* When a rewrite to proxy is configured in the server config, a check is made ↵Christophe Jaillet2018-08-221-0/+10
| | | | | | | | | | | | to make sure mod_proxy is active. But the same is not done if a rewrite to proxy is configured in an .htaccess file. Basically this patch is the block of code from hook_uri2file that does the proxy check, copied to hook_fixup. Patch provided by Michael Streeter [mstreeter1 gmail.com], slightly modified to use a new APLOGNO PR 56264 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1838684 13f79535-47bb-0310-9956-ffa450edef68
* If several directories are given in a UserDir directive, only files in the ↵Christophe Jaillet2018-05-261-1/+12
| | | | | | | | | | first existing one are checked. If the file is not found there, the other possible directories are not checked. The doc clearly states that they will be checked one by one, until a match is found or an external redirect is performed. PR 59636. While at it, add some debug messages to better understand what is performed. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1832306 13f79535-47bb-0310-9956-ffa450edef68
* PR62311: only create the rewritelock when neededEric Covener2018-05-171-9/+12
| | | | | | | | | | Submitted By: Hank Ibell <hwibell gmail.com> Committed By: covener git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1831773 13f79535-47bb-0310-9956-ffa450edef68
* Fix some typos reported in PR 59998Christophe Jaillet2018-03-241-1/+1
| | | | | | | | Most add already been fixed when PR 59990 had been applied on trunk. Thx klemens git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1827669 13f79535-47bb-0310-9956-ffa450edef68
* Follow up to r1740928: including NOT_IN_PROXY in NOT_IN_DIR_LOC_FILE is bothYann Ylavic2017-10-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | incomplete and not backportable, fix it by introducing NOT_IN_DIR_CONTEXT and restoring NOT_IN_DIR_LOC_FILE to its previous value. Per ap_check_cmd_context(), NOT_IN_DIR_LOC_FILE actually/really means "not in any directory context", while the definition itself does not include all the existing directory contexts (e.g. <Limit>, or <Proxy> before r1740928). This is a bit of a misnomer, at least, so instead of (ab)using it by adding the missing contexts (in an incompatible way), let's define NOT_IN_DIR_CONTEXT to really exclude all directory context (i.e. NOT_IN_DIR_LOC_FILE + NOT_IN_LIMIT + NOT_IN_PROXY) and use it wherever NOT_IN_DIR_LOC_FILE was used. This is by itself a major MMN bump (modules not compiled with this commit and having directives checked against NOT_IN_DIR_LOC_FILE won't be caught the same way by NOT_IN_DIR_CONTEXT in the new ap_check_cmd_context() code), but with the below change, 2.4.x should work as before: - if ((forbidden & NOT_IN_DIR_CONTEXT) == NOT_IN_DIR_CONTEXT) { + if ((forbidden & NOT_IN_DIR_LOC_FILE) == NOT_IN_DIR_LOC_FILE) { if (cmd->path != NULL) { return apr_pstrcat(cmd->pool, cmd->cmd->name, gt, - " cannot occur within directory context", NULL); + " cannot occur within <Directory/Location/Files/Proxy> " + "section", NULL); } ... } git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1812193 13f79535-47bb-0310-9956-ffa450edef68
* core, mod_rewrite: introduce the 'redirect-keeps-vary' noteLuca Toscano2017-10-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1811744 13f79535-47bb-0310-9956-ffa450edef68
* mod_rewrite,core: avoid Vary:Host (part 2)Luca Toscano2017-09-201-5/+5
| | | | | | | | | | | | | | | | | | This is a follow up of r1808746 after a chat with Yann on dev@: - the HTTP:Host variable suffers from the same problem - the strcasecmp should be used to allow case-sensitive comparisons. - in mod_rewrite is less cumbersome and more clean to just make the Host header check in lookup_header, so it will be automatically picked up by every part of the code that uses it. It shouldn't be a relevant overhead for mod_rewrite. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1809028 13f79535-47bb-0310-9956-ffa450edef68
* mod_speling/PR 38923: don't embed Referer in link in error page.Nick Kew2017-09-181-4/+4
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1808780 13f79535-47bb-0310-9956-ffa450edef68
* mod_rewrite/core: avoid the 'Vary: Host' headerLuca Toscano2017-09-181-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | In PR 58231 is was brought up that httpd adds the Vary: Host header whenever a condition is set to true in mod_rewrite or in an <If> block. The https://tools.ietf.org/html/rfc7231#section-7.1.4 section seems to disallow this use case: "The "Vary" header field in a response describes " "what parts of a request message, " "aside from the method, Host header field, [...]" I had a chat with the folks in #traffic-server and they don't see much point in having a Vary: Host header, plus it was reported that Varnish doesn't like it very much (namely it does not cache the response when it sees the header, links of the report in the PR). I don't see much value in this behavior of httpd so I am inclined to remove this response header value, but I'd be glad to get a more experienced opinion. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1808746 13f79535-47bb-0310-9956-ffa450edef68
* Fix negotiation type parsing to be strict about "*", "*/*" and "type/*"William A. Rowe Jr2017-07-051-3/+8
| | | | | | | | | | comparisons. Submitted by: wrowe, Robert Święcki <robert swiecki.net> git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1800917 13f79535-47bb-0310-9956-ffa450edef68
* Partial reversal of r1800306... note virtual scripts in notesJim Jagielski2017-06-301-1/+5
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1800393 13f79535-47bb-0310-9956-ffa450edef68
* proxy_fcgi: remove FPM-specific logicJacob Champion2017-06-291-5/+1
| | | | | | | | | | Reverts r1780328, r1780329, and their associated followups, which incorrectly manipulated SCRIPT_NAME by default. All proxy_fcgi.t regression tests now pass. PR: 61202 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1800306 13f79535-47bb-0310-9956-ffa450edef68