1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-06 16:49:32 +03:00
Commit Graph

336 Commits

Author SHA1 Message Date
Graham Leggett
3aecbb0543 mod_rewrite: Fix the RewriteEngine directive to work within a
location. Previously, once RewriteEngine was switched on globally,
it was impossible to switch off.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1032431 13f79535-47bb-0310-9956-ffa450edef68
2010-11-08 00:41:35 +00:00
Eric Covener
a81eb0d43d Add an END flag to RewriteRule that acts like L=LAST but also prevents
further rounds of rewrite processing due to per-directory substitutions.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1028778 13f79535-47bb-0310-9956-ffa450edef68
2010-10-29 14:43:49 +00:00
Stefan Fritsch
8a9e6cd208 return early if we are not logging anyway
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023063 13f79535-47bb-0310-9956-ffa450edef68
2010-10-15 18:36:22 +00:00
Stefan Fritsch
affc4cf328 save some memory by using cmd->temp_pool instead of cmd->pool in some places
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1002156 13f79535-47bb-0310-9956-ffa450edef68
2010-09-28 13:19:33 +00:00
William A. Rowe Jr
e9bdc417d6 Introduce integer comparison support in RewriteCond
The operators -gt, -ge, -eq, -le, -lt and -ne follow the bash test' semantics
for comparing the integer values of the lhs and rhs expressions, as opposed
to the string evaluations performed by > >= = <= and <.

Note that -lt and -le overlap the existing -l test, and could be confused in
expresions such as -ltestfile - to avoid this conflict use -L or -h in place
of the legacy -l file symlink test operator.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@997878 13f79535-47bb-0310-9956-ffa450edef68
2010-09-16 18:57:23 +00:00
William A. Rowe Jr
fb6d2cd8e2 Reduce complexity and fix a regex.t based on observation by rpluem;
- follow the same logic of '=' for >[=] and <[=], skipping p->type chars
   for the resulting p->pattern
  
 - introduce pskip logic to greatly simplify logging, track negation '!', '=', 
   and new comparators ">/<[=]", backspacing only for the purpose of logging.
   It's trivial to expand this to the -X operators in the future.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@997869 13f79535-47bb-0310-9956-ffa450edef68
2010-09-16 18:14:32 +00:00
William A. Rowe Jr
1038d34486 *) Accept modern bash test conventions of -h or -L for testing symlinks
(for another patch against -l yet-to-come)

*) Introduce >= and <= syntax for greater-or-equal, or less-or-equal
   string comparisons

*) Respect [NC] conventions for >[=]/<[=] string comparison, which is
   horribly sensitive to the current charset.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@997553 13f79535-47bb-0310-9956-ffa450edef68
2010-09-16 00:54:58 +00:00
Jeff Trawick
62cb0bdaff set default pattern type using the enum value instead of
integer literal (Intel C compiler groans about this)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@991516 13f79535-47bb-0310-9956-ffa450edef68
2010-09-01 12:43:03 +00:00
Stefan Fritsch
7ffa5cece3 mod_rewrite: Log errors if rewrite map files cannot be opened
PR: 49639


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@986921 13f79535-47bb-0310-9956-ffa450edef68
2010-08-18 20:35:43 +00:00
Stefan Fritsch
5c22b85454 Remove obsolete "see error log" log messages.
mod_rewrite now uses the error log.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@986912 13f79535-47bb-0310-9956-ffa450edef68
2010-08-18 20:22:51 +00:00
Stefan Fritsch
f0fdf298c3 remove some useless use of strlen()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@982017 13f79535-47bb-0310-9956-ffa450edef68
2010-08-03 19:49:21 +00:00
Stefan Fritsch
02dc2d45cf Code cleanup: replace strncpy by apr_cpystrn or apr_pstrmemdup
Submitted by: Takashi Sato <takashi lans tv com>
PR: 43432


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@981086 13f79535-47bb-0310-9956-ffa450edef68
2010-07-31 20:08:44 +00:00
Rainer Jung
a52fa4db6d Remove superfluous EOL from mod_rewrite logging.
It's no longer needed, since mod_rewrite now uses
our usual error log. The superfluous EOL was logged
as '\n'.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@960236 13f79535-47bb-0310-9956-ffa450edef68
2010-07-03 17:01:23 +00:00
Rainer Jung
60e8f3a913 Allow to set environment variables using mod_rewrite without
explicitely giving a value.

Most modules only check presence of a variable, not the
value, so it makes sense to make the VAL argument in
the mod_rewrite ENV flag optional.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@960233 13f79535-47bb-0310-9956-ffa450edef68
2010-07-03 16:21:58 +00:00
Eric Covener
e89325dac5 mod_rewrite.c:447: warning: format not a string literal and no format arguments
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@953785 13f79535-47bb-0310-9956-ffa450edef68
2010-06-11 17:39:17 +00:00
Stefan Fritsch
a5f4ee1845 Replace RewriteLog/RewriteLogLevel with trace log levels
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951903 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 17:09:43 +00:00
Stefan Fritsch
ebb62867fb Use the new APLOG_USE_MODULE/AP_DECLARE_MODULE macros everywhere to take
advantage of per-module loglevels


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951895 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 16:59:50 +00:00
William A. Rowe Jr
01d300298f Catch up with ap_[proc|global]_mutex_create api change
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@940981 13f79535-47bb-0310-9956-ffa450edef68
2010-05-04 17:40:43 +00:00
Stefan Fritsch
3560f2e015 Turn static function get_server_name_for_url() into public function
ap_get_server_name_for_url() and use it where appropriate. This fixes
mod_rewrite generating invalid URLs for redirects to IPv6 literal addresses.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@900022 13f79535-47bb-0310-9956-ffa450edef68
2010-01-16 20:32:09 +00:00
Rich Bowen
c4b0fa2f7d Adds a [QSD] flag to RewriteRule to discard unwanted query strings
without the old kludge of sticking a ? on the end of the target URI.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@894383 13f79535-47bb-0310-9956-ffa450edef68
2009-12-29 13:34:24 +00:00
Jeff Trawick
2e9668a33d Replace AcceptMutex, LockFile, RewriteLock, SSLMutex, SSLStaplingMutex,
and WatchdogMutexPath with a single Mutex directive.  Add APIs to
simplify setup and user customization of APR proc and global mutexes.  
(See util_mutex.h.)  Build-time setting DEFAULT_LOCKFILE is no longer
respected; set DEFAULT_REL_RUNTIMEDIR instead.

Some existing modules, such as mod_ldap and mod_auth_digest gain 
configurability for their mutexes.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@883540 13f79535-47bb-0310-9956-ffa450edef68
2009-11-23 23:17:51 +00:00
Graham Leggett
eded0f9d2d mod_rewrite: Make sure that a hostname:port isn't fully qualified if
the request is a CONNECT request.
Submitted by: Bill Zajac <billz consultla.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@822004 13f79535-47bb-0310-9956-ffa450edef68
2009-10-05 20:56:48 +00:00
Brian Havard
60fbe11de1 Bring back OS/2 support.
Reverses r758929 with a little bit of conflict resolution.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@807930 13f79535-47bb-0310-9956-ffa450edef68
2009-08-26 08:56:13 +00:00
Ruediger Pluem
d0f13e518c * Remove locking for writing to the rewritelog. There seems to be no reason
why locking is required here.
  See also: http://marc.info/?l=apache-httpd-dev&m=124282193217344&w=2

PR: 46942
Submitted by:  Dan Poirier <poirier pobox.com>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@783734 13f79535-47bb-0310-9956-ffa450edef68
2009-06-11 12:19:44 +00:00
Takashi Sato
769b8833b8 Fix the error string returned by RewriteRule. RewriteRule returned "RewriteCond: bad flag delimiters" when the 3rd argument of RewriteRule was not started with "[" or not ended with "]".
PR: 45082
Submitted by: Vitaly Polonetsky <m_vitaly topixoft.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@776325 13f79535-47bb-0310-9956-ffa450edef68
2009-05-19 14:24:31 +00:00
Jeff Trawick
ee32468a33 remove OS/2 platform support
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758929 13f79535-47bb-0310-9956-ffa450edef68
2009-03-26 23:47:52 +00:00
Joe Orton
2e8c914840 * modules/mappers/mod_rewrite.c (apply_rewrite_rule): When evaluating
a proxy rule in directory context, do escape the filename by
  default, since mod_proxy will not escape in that case due to the
  (deliberate) fixup hook ordering.

Thanks to: rpluem
PR: 46428


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@757427 13f79535-47bb-0310-9956-ffa450edef68
2009-03-23 15:59:36 +00:00
Paul Querna
26e8e1c27f Add IPv6 variable to mod_rewrite.
Submitted by: Ryan Phillips <ryan-apache trolocsis.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@737973 13f79535-47bb-0310-9956-ffa450edef68
2009-01-27 02:12:37 +00:00
Nick Kew
774d09ec23 Fix mod_rewrite "B" flag breakage by reverting r589343
PR#45529


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@730274 13f79535-47bb-0310-9956-ffa450edef68
2008-12-31 00:08:00 +00:00
André Malo
6da5f085da add mod_proxy_scgi, as announced a long time ago
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@729538 13f79535-47bb-0310-9956-ffa450edef68
2008-12-26 21:41:48 +00:00
Eric Covener
c23d3f839e axe r->path_info in a more standard way, suggested by Aleksander Budzynowski
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@728220 13f79535-47bb-0310-9956-ffa450edef68
2008-12-20 01:53:26 +00:00
Eric Covener
6710f37922 *) mod_rewrite: Introduce DiscardPathInfo|DPI flag to stop the troublesome
way that per-directory rewrites append the previous notion of PATH_INFO
    to each substitution before evaluating subsequent rules.
    PR38642 [Eric Covener]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@728015 13f79535-47bb-0310-9956-ffa450edef68
2008-12-19 12:59:52 +00:00
Paul Querna
f47b6f394e Import the core parts of the DTrace patch. This is a modified and updated
version of what was submited by Theo before:
 <http://mail-archives.apache.org/mod_mbox/httpd-dev/200805.mbox/%3C6AFBCFE8-4CCA-4A02-8A43-F9170689695D@omniti.com%3E>

Note, this does not hook it up into the build system at this time, because
the original patch was a little too creative there.

Submitted By: Theo Schlossnagle <jesus omniti.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@723565 13f79535-47bb-0310-9956-ffa450edef68
2008-12-05 03:34:52 +00:00
Paul Querna
a73acf02f6 API Cleanup in preperation for 2.4.x, make sure all exported functions or variables contain an ap_ prefix.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@722399 13f79535-47bb-0310-9956-ffa450edef68
2008-12-02 08:13:36 +00:00
Joe Orton
0be485f9f5 * modules/mappers/mod_rewrite.c (do_rewritelog): Add prototype with
printf attribute flagged so that gcc -Wformat-security will pick
  up PR 46110-type errors as a warning.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@708655 13f79535-47bb-0310-9956-ffa450edef68
2008-10-28 20:11:43 +00:00
Ruediger Pluem
d67914065e * Supply the per-dir parameter to the rewritelog call where it is needed.
PR: 46110


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@708654 13f79535-47bb-0310-9956-ffa450edef68
2008-10-28 20:02:53 +00:00
Joe Orton
a1df46e986 * modules/mappers/mod_rewrite.c (cmd_rewritelock): Add missing
sentinel.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@683284 13f79535-47bb-0310-9956-ffa450edef68
2008-08-06 14:47:04 +00:00
Jim Jagielski
72e89c84a7 picking nits - de-tab
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@682788 13f79535-47bb-0310-9956-ffa450edef68
2008-08-05 16:52:12 +00:00
Ruediger Pluem
3a61888c4b * Fix formating. No functional change.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@670254 13f79535-47bb-0310-9956-ffa450edef68
2008-06-21 20:02:21 +00:00
Thomas J. Donovan
62febaa7fc correct r670061 - preserve query string with [noescape, proxy]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@670198 13f79535-47bb-0310-9956-ffa450edef68
2008-06-21 13:48:45 +00:00
Thomas J. Donovan
70845bf8b9 After r649840, mod_proxy_http will no longer append a query string from r->args if "no-canon".
Moved the NOESCAPE test down after PATH_INFO, and preserve the query string in r->filename if  
NOESCAPE (which implies "no-canon")

Previously this was only done for CONNECT requests, where (r->uri == r->unparsed_uri)
see mod_proxy:proxy_detect



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@670061 13f79535-47bb-0310-9956-ffa450edef68
2008-06-20 21:12:34 +00:00
Ruediger Pluem
cf66e3894d * Offer the possibility to create session cookies in the case a path is
given.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@664333 13f79535-47bb-0310-9956-ffa450edef68
2008-06-07 12:50:04 +00:00
Ruediger Pluem
140715a336 * Allow HttpOnly, 1 and true to enable HttpOnly, allow secure, 1 and true
to enable secure.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@664330 13f79535-47bb-0310-9956-ffa450edef68
2008-06-07 12:29:27 +00:00
Ruediger Pluem
c506a9d1a7 * Make setting of HttpOnly flag more explicit.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@660566 13f79535-47bb-0310-9956-ffa450edef68
2008-05-27 15:49:30 +00:00
Ruediger Pluem
f8ca06dce0 * Handle the case that secure is NULL
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@660461 13f79535-47bb-0310-9956-ffa450edef68
2008-05-27 10:50:23 +00:00
Ruediger Pluem
93a75ba455 * Allow Cookie option to set secure and HttpOnly flags
PR: 44799
Submitted by: Christian Wenz <christian wenz.org>
Reviewed by: rpluem



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@647395 13f79535-47bb-0310-9956-ffa450edef68
2008-04-12 08:44:36 +00:00
Ruediger Pluem
c998f6f688 * Initialize hash needed by ap_register_rewrite_mapfunc early enough.
PR: 44641
Submitted by: Daniel Lescohier <daniel.lescohier cnet.com>
Reviewed by: rpluem, niq, wrowe, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@639465 13f79535-47bb-0310-9956-ffa450edef68
2008-03-20 21:26:22 +00:00
Ruediger Pluem
b18ee30e41 * Add checkfile2 at the end of the struct and not in the middle of the struct.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@633791 13f79535-47bb-0310-9956-ffa450edef68
2008-03-05 08:53:16 +00:00
Niklas Edmundsson
ad47fb39d6 mod_rewrite: Check all files used by DBM maps for freshness, mod_rewrite
didn't pick up on updated sdbm maps due to this.
PR41190 [Niklas Edmundsson]

NOTE: Only tested on httpd-2.2.8.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@632730 13f79535-47bb-0310-9956-ffa450edef68
2008-03-02 09:58:56 +00:00
Nick Kew
8c1e306031 mod_rewrite: Don't canonicalise URLs with [P,NE]
PR 43319


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@611134 13f79535-47bb-0310-9956-ffa450edef68
2008-01-11 10:52:09 +00:00