Project

General

Profile

Feature #1556

Allow matching against any arbitrary HTTP header in the configuration file regexps

Added by jrabbit almost 10 years ago. Updated 9 months ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
core
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Missing in 1.5.x:

Description

It should be possible to match against any HTTP header from the config file, rather than being limited to only matching against Host, User-Agent, Referrer and Cookie.

I can think of 3 ways to achieve this:

1. Introduce a new $REQUEST[] table in the configuration file that allows matching against any header, and leave the Host, User-Agent, Referrer and Cookie options in the $HTTP[] table for backwards compatibility. This means there are two ways of testing against these 4 headers, which is against the lighttpd spirit of lightness.

2. Introduce $REQUEST[] as above, and remove the Host, User-Agent, Referrer and Cookie options from $HTTP[]. This isn't backwards compatible but is the architecturally cleanest option.

3. Treat any string between the brackets in $HTTP[] that is not recognized as having special meaning to lighttpd as a header name to match against. This has the downside that there is a small risk of current $HTTP[] options such as "remoteip" conflicting with future HTTP header names. However, it does mean that internally in the code, the Host, User-Agent, Referrer and Cookie options could be removed as special cases without changing their functionality to end users.

NOTE: Implementing this arbitrary header matching would also resolve ticket 1119.


Related issues

Related to Feature #505: Complete header variable matchingDuplicate

Associated revisions

Revision 2ac2911b (diff)
Added by gstrauss 10 months ago

[core] config match w/ arbitrary HTTP request hdrs (fixes #1556)

x-ref:
"Allow matching against any arbitrary HTTP header in the configuration file regexps"
https://redmine.lighttpd.net/issues/1556

Revision 78047a3c (diff)
Added by gstrauss 9 months ago

[core] $REQUEST_HEADER[...] subsumes other config (#1556)

x-ref:
"Allow matching against any arbitrary HTTP header in the configuration file regexps"
https://redmine.lighttpd.net/issues/1556

Revision 7bd46d19 (diff)
Added by gstrauss about 1 month ago

[core] fix $REQUEST_HEADER[...] parsing in config (#1556)

x-ref:
"Allow matching against any arbitrary HTTP header in the configuration file regexps"
https://redmine.lighttpd.net/issues/1556
https://redmine.lighttpd.net/boards/2/topics/7609

History

#1

Updated by gstrauss over 1 year ago

  • Related to Feature #505: Complete header variable matching added
#2

Updated by gstrauss over 1 year ago

  • Assignee deleted (jan)
#3

Updated by gstrauss over 1 year ago

  • Target version deleted (1.5.0)
#4

Updated by gstrauss 10 months ago

  • Description updated (diff)
  • Status changed from New to Patch Pending
  • Target version set to 1.4.46

Any strong preferences between naming this $HEADER["..."] versus $REQUEST["..."]?

#5

Updated by gstrauss 9 months ago

  • Status changed from Patch Pending to Fixed
  • % Done changed from 0 to 100

Also available in: Atom