mod_headers.c

Checkout Tools
  • last updated 5 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
This is harmless, but this really should be an 'echo_do *'
avoid ap_set_content_type when processing a _Request_Header set|edit|unset Content-Type.

identified by ylavic

  1. … 1 more file in changeset.
PR 61983: "Header unset Content-Type" doesn't work

Submitted By: Hank Ibell <hwibell gmail.com>

Committed By: covener

  1. … 1 more file in changeset.
Remove unnecessary apr_table_do() function casts

Function casts can cause hard-to-debug corruption issues if a

declaration is accidentally changed to be incompatible. Luckily, most of

the function casts for apr_table_do() calls are unnecessary. Remove

them, and adjust the signatures for helpers that weren't taking void* as

the first argument.

The remaining helper that requires a cast is http_filter.c's

form_header_field(), which is probably where many of these casts were

copy-pasted from. I have left it as-is: it has other direct callers

besides apr_table_do(), and it's already documented with warnings not to

change the function signature.

  1. … 4 more files in changeset.
Rename ap_casecmpstr[n]() to ap_cstr_casecmp[n](), update with APR doxygen
  1. … 49 more files in changeset.
Use new ap_casecmpstr[n]() functions where appropriate (not exhaustive).

  1. … 32 more files in changeset.
Revert r1715789: will re-commit without spurious functional changes.

  1. … 32 more files in changeset.
Use new ap_casecmpstr[n]() functions where appropriate (not exhaustive).

[Reverted by r1715869]

  1. … 32 more files in changeset.
This is annoying to see in a casual "LogLevel debug foo:traceX ..."

If the "value" argument is prefixed with expr=, parse it with ap_expr

rather than mod_headers' built-in format strings.

  1. … 2 more files in changeset.
Allow for format specifiers to be used in the base substitution string for Header edit
  1. … 1 more file in changeset.
add "Header note" which was the solution for two users this week on IRC.

  1. … 2 more files in changeset.
provide a simple (no <If>) way to set a header only if it's not already there.

  1. … 2 more files in changeset.
Remove useless tests.

Turn

if (*x && apr_isspace(*x))

into

if (apr_isspace(*x))

  1. … 9 more files in changeset.
Might as well show 'em all
Allow for exposure of loadavg and server load via mod_headers
Add lots of unique tags to error log messages

  1. … 172 more files in changeset.
Check return value of ap_pregsub()

Unify syntax of config directives taking an expression as optional contition argument

  1. … 5 more files in changeset.
Replace literal constant with AP_MAX_REG_MATCH

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

  1. … 2 more files in changeset.
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

  1. … 14 more files in changeset.
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.

  1. … 2 more files in changeset.
Log errors/infos during expression evaluation and associate the message

with the module that is calling ap_expr_exec()

  1. … 6 more files in changeset.
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

  1. … 34 more files in changeset.
Change the default of the Header directive to apply to responses of all types

instead of just 2xx successful responses.

  1. … 1 more file in changeset.
rename the mod_headers variables used to track onsuccess vs. always for clarity

save some memory by using cmd->temp_pool instead of cmd->pool in some places

  1. … 6 more files in changeset.
Fix omission in r894036 noted by rpluem.

Use the new APLOG_USE_MODULE/AP_DECLARE_MODULE macros everywhere to take

advantage of per-module loglevels

  1. … 169 more files in changeset.