1
0
mirror of https://github.com/apache/httpd.git synced 2026-01-13 21:42:17 +03:00
Commit Graph

102 Commits

Author SHA1 Message Date
Eric Covener
5a63e124b6 This is annoying to see in a casual "LogLevel debug foo:traceX ..."
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1552130 13f79535-47bb-0310-9956-ffa450edef68
2013-12-18 22:25:50 +00:00
Eric Covener
d5174b9fcd If the "value" argument is prefixed with expr=, parse it with ap_expr
rather than mod_headers' built-in format strings.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1546801 13f79535-47bb-0310-9956-ffa450edef68
2013-12-01 11:23:22 +00:00
Daniel Ruggeri
ffdb1b50a1 Allow for format specifiers to be used in the base substitution string for Header edit
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1535788 13f79535-47bb-0310-9956-ffa450edef68
2013-10-25 17:16:46 +00:00
Eric Covener
46d97009e1 add "Header note" which was the solution for two users this week on IRC.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1520908 13f79535-47bb-0310-9956-ffa450edef68
2013-09-08 20:04:06 +00:00
Eric Covener
1c3427493e provide a simple (no <If>) way to set a header only if it's not already there.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1496338 13f79535-47bb-0310-9956-ffa450edef68
2013-06-25 02:20:36 +00:00
Christophe Jaillet
bb69ec6cfe Remove useless tests.
Turn
   if (*x && apr_isspace(*x))
into
   if (apr_isspace(*x))

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1452128 13f79535-47bb-0310-9956-ffa450edef68
2013-03-03 21:25:46 +00:00
Jim Jagielski
769f9a490b Might as well show 'em all
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1389566 13f79535-47bb-0310-9956-ffa450edef68
2012-09-24 20:51:03 +00:00
Jim Jagielski
25b64e92ed Allow for exposure of loadavg and server load via mod_headers
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1389565 13f79535-47bb-0310-9956-ffa450edef68
2012-09-24 20:51:00 +00:00
Stefan Fritsch
92e366007c Add lots of unique tags to error log messages
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209766 13f79535-47bb-0310-9956-ffa450edef68
2011-12-02 23:02:04 +00:00
Stefan Fritsch
646971c214 Check return value of ap_pregsub()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1198948 13f79535-47bb-0310-9956-ffa450edef68
2011-11-07 21:29:57 +00:00
Stefan Fritsch
6c57e61b1b Unify syntax of config directives taking an expression as optional contition argument
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1197413 13f79535-47bb-0310-9956-ffa450edef68
2011-11-04 07:27:07 +00:00
Stefan Fritsch
b9196c6dfd Replace literal constant with AP_MAX_REG_MATCH
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1185849 13f79535-47bb-0310-9956-ffa450edef68
2011-10-18 20:51:35 +00:00
Stefan Fritsch
62441a77e4 Fix issues found by PVS-Studio static analyzer:
mod_mime_magic:
cut'n'paste error rsl_encoding vs. rsl_separator, also simplify code a bit

mod_header:
wrong string initialization (leading to segfault if format argument is missing)

util_win32: duplicate sizeof (untested; Windows people, please review)

PR: 51542
Submitted by: Andrey Karpov <karpov viva64 com>, Stefan Fritsch


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1172732 13f79535-47bb-0310-9956-ffa450edef68
2011-09-19 18:04:47 +00:00
Stefan Fritsch
46d4791a5d Add string valued expressions to ap_expr, do some API cleanup
- add possibility to have expressions that evaluate to a string and not to
  a boolean value
- modify ap_expr_parse_cmd() interface to support this and make it more
  convenient to use in general
- rename AP_EXPR_FLAGS_* to AP_EXPR_FLAG_* for consistency


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1142164 13f79535-47bb-0310-9956-ffa450edef68
2011-07-02 07:45:00 +00:00
Eric Covener
7a76afb8b3 revert r1031670:
Change the default of the Header directive to apply to responses of all types
    instead of just 2xx successful responses.

This turned out to be do more harm than good for anything other 
than "set", since "always" doesn't ever see/operate on existing 
r->headers_out headers -- just err_headers_out. 

I think onsuccess needs to remain the default and this needs to move into a 
doc revamp.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1053516 13f79535-47bb-0310-9956-ffa450edef68
2010-12-29 03:08:44 +00:00
Stefan Fritsch
c40fa87ce7 Log errors/infos during expression evaluation and associate the message
with the module that is calling ap_expr_exec()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1037140 13f79535-47bb-0310-9956-ffa450edef68
2010-11-20 08:59:50 +00:00
Stefan Fritsch
35cdba6976 Replace ap_expr with a parser derived from mod_ssl's parser. Make mod_ssl use
the new parser. Rework ap_expr's public interface and provide hooks for modules
to add variables and functions.

The Netware and Windows build files still need to be adjusted


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1032073 13f79535-47bb-0310-9956-ffa450edef68
2010-11-06 14:31:16 +00:00
Eric Covener
c145eb760d Change the default of the Header directive to apply to responses of all types
instead of just 2xx successful responses.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1031670 13f79535-47bb-0310-9956-ffa450edef68
2010-11-05 17:20:31 +00:00
Eric Covener
5398ce8195 rename the mod_headers variables used to track onsuccess vs. always for clarity
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1031669 13f79535-47bb-0310-9956-ffa450edef68
2010-11-05 17:15:50 +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
Nick Kew
8dfbc67165 Fix omission in r894036 noted by rpluem.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@966059 13f79535-47bb-0310-9956-ffa450edef68
2010-07-21 00:20: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
Joe Orton
e588bbc955 * modules/metadata/mod_headers.c: Add a function pointer type for
the tag handler callback to regain some type-safety.
  (register_format_tag_handler, header_pre_config): Adjusted.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@946173 13f79535-47bb-0310-9956-ffa450edef68
2010-05-19 13:15:21 +00:00
William A. Rowe Jr
115c1e496d Correctly align the behavior of headers_in to be consistent with the
treatment of headers_out, resolving PR 48359 by keeping subrequest
scope changes out of the main request headers.  This ensures that all
requests-without-bodies behave as the requests-with-bodies code has.

Mitre: CVE-2010-0434


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@901578 13f79535-47bb-0310-9956-ffa450edef68
2010-01-21 07:19:41 +00:00
Nick Kew
76ea26f7a0 mod_headers: Enable multi-match-and-replace edit option
PR 47066


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@894036 13f79535-47bb-0310-9956-ffa450edef68
2009-12-27 00:05:12 +00:00
Nick Kew
65d3f49bac mod_headers: align Header Edit with Header Set on Content-Type
PR 48422
Adapted patch from Cyril Bonté


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@894034 13f79535-47bb-0310-9956-ffa450edef68
2009-12-26 23:05:39 +00:00
Ruediger Pluem
140031be51 * Ensure that the new table values are allocated from the pool of the main
request as they might be added to the header tables of the main request.
  Otherwise these values might become invalid once the subrequest and its
  pool gets destroyed.

PR: 48359
Submitted by: rpluem, niq
Reviewed by: niq


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@889408 13f79535-47bb-0310-9956-ffa450edef68
2009-12-10 20:18:05 +00:00
Nick Kew
165dc73d4d mod_headers: generalise the envclause to support conditional
header rules via ap_expr.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@808240 13f79535-47bb-0310-9956-ffa450edef68
2009-08-27 01:02:42 +00:00
Issac Goldstand
0332b0d0f7 Change r->content_type when mod_headers sets the Content-Type header
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@680082 13f79535-47bb-0310-9956-ffa450edef68
2008-07-27 09:23:26 +00:00
Ruediger Pluem
86efa65bf8 * Prevent Header edit from processing only the first header it should
edit and deleting the remaining ones by iterating over all headers
  with the same name.

PR: 45333


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@674000 13f79535-47bb-0310-9956-ffa450edef68
2008-07-04 10:54:36 +00:00
William A. Rowe Jr
15cbde5423 Supress the warning for compilers which fold *end-*start into ssize_t.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@568879 13f79535-47bb-0310-9956-ffa450edef68
2007-08-23 08:12:55 +00:00
Chris Darroch
169e22c568 add merge option to avoid duplicate values within the same header
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@568323 13f79535-47bb-0310-9956-ffa450edef68
2007-08-21 23:22:00 +00:00
Ruediger Pluem
d8c62064ba * Fix a off-by-one error in parse_format_tag in the case that the last character
of the string to which *sa points is a %. In this case the while loop in
  parse_format_string would call parse_format_tag with a pointer to a memory
  region that starts one byte after the string to which s in parse_format_string
  points to.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@499567 13f79535-47bb-0310-9956-ffa450edef68
2007-01-24 21:08:44 +00:00
Nick Kew
c9c0bbb448 PR#36609 - permit % as the last character of a Header value
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@490156 13f79535-47bb-0310-9956-ffa450edef68
2006-12-25 17:40:10 +00:00
Nick Kew
4034b23cc0 Support regexp-based manipulation of HTTP headers
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@452330 13f79535-47bb-0310-9956-ffa450edef68
2006-10-03 07:41:27 +00:00
Roy T. Fielding
de659cbed0 update license header text
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@420983 13f79535-47bb-0310-9956-ffa450edef68
2006-07-11 20:33:53 +00:00
Colm MacCarthaigh
dd95d7c37c Update the copyright year in all .c, .h and .xml files
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@395228 13f79535-47bb-0310-9956-ffa450edef68
2006-04-19 12:11:27 +00:00
Jim Jagielski
5061d9fa92 No functional Change: Removing trailing whitespace. This also
means that "blank" lines consisting of just spaces or
tabs are now really blank lines


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332306 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:11:44 +00:00
Jim Jagielski
5d2fae4818 No functional change: simple detabbing of indented code.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332305 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:05:51 +00:00
Joe Orton
a0570c8746 Move the POSIX reg* implementations into the ap_* namespace;
internalise the ap_reg*<->PCRE wrapper:

* configure.in: Add srclib/pcre to the include path.

* include/ap_regex.h: Renamed from include/pcreposix.h.  Prefix all
constants with AP_; prefix all functions and types with ap_.  Define
AP_DECLARE to nothing if necessary.  Remove regcomp error codes.

* include/httpd.h: Include ap_regex.h not pcreposix.h.
(ap_pregcomp, ap_regexec, ap_regfree): s/regex_t/ap_regex_t/.
(ap_regexec, ap_regerror): Prototypes moved to ap_regex.h.

* server/util.c (regex_cleanup, ap_pregcomp, ap_pregsub, ap_pregfree):
Adjust for ap_ prefixed types.  (ap_regexec, ap_regerror): Removed.

* server/Makefile.in: Build util_pcre.c.

* server/util_pcre.c: Copied from srclib/pcre/pcreposix.c; remove use
of PCRE-internals to do error mapping; rename types to add AP_/ap_
prefixes as above.  Use APR includes.  (ap_regerror): Use apr_snprintf.

* srclib/pcre/Makefile.in: Don't build pcreposix.c into libpcre.la.

* modules/*: Update to use new type and constant names.

PR: 27750 (part one)
Submitted by: Andres Salomon <dilinger voxel.net>, Joe Orton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@153384 13f79535-47bb-0310-9956-ffa450edef68
2005-02-11 12:00:41 +00:00
Justin Erenkrantz
905cdf9f0b Update copyright year to 2005 and standardize on current copyright owner line.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151408 13f79535-47bb-0310-9956-ffa450edef68
2005-02-04 20:28:49 +00:00
Nick Kew
0ebb8b9b9a Implement "Early" mode in mod_headers, and document it.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104170 13f79535-47bb-0310-9956-ffa450edef68
2004-07-05 04:49:45 +00:00
André Malo
8fb0fc2705 Drop the ErrorHeader directive which turned out to be a misnomer.
Instead there's a new optional flag for the Header directive
('always'), which keeps the former ErrorHeader functionality.

The opposite flag to 'always' is 'onsuccess'. So the new directives are written
as:

Header set foo bar
# which is the same as
Header onsuccess set foo bar
# and a subset of
Header always set foo bar
# which is what the ErrorHeader directive did.

Reviewed by: Brad Nicholes


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103920 13f79535-47bb-0310-9956-ffa450edef68
2004-06-11 21:41:27 +00:00
André Malo
f6d2e82e3a allow %% to represent a literal %.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103446 13f79535-47bb-0310-9956-ffa450edef68
2004-04-18 20:26:07 +00:00
André Malo
d2dd505a5f allow env clauses also for 'echo' and 'unset'
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103445 13f79535-47bb-0310-9956-ffa450edef68
2004-04-18 19:55:20 +00:00
André Malo
71b8739c3c Allow ErrorHeader echo
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103444 13f79535-47bb-0310-9956-ffa450edef68
2004-04-18 19:42:34 +00:00
André Malo
46e408aa32 don't segfault, when setting an empty header value
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103442 13f79535-47bb-0310-9956-ffa450edef68
2004-04-18 19:17:43 +00:00
André Malo
d2b67717b6 simplifications
There's no need for different server and dir configs.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103441 13f79535-47bb-0310-9956-ffa450edef68
2004-04-18 19:05:49 +00:00
André Malo
e71e4d1d21 remove unused parameters and minor memory leak
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103440 13f79535-47bb-0310-9956-ffa450edef68
2004-04-18 17:11:09 +00:00
André Malo
34d7a51e92 :retab
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103439 13f79535-47bb-0310-9956-ffa450edef68
2004-04-18 16:25:16 +00:00