Feature #1749
closedMake lighty.request fully writable in mod_magnet
Description
Without this patch changes in lighty.request table don't go outside of mod_magnet.
Test case:
revproxy.lua:
lighty.request["Host"] = lighty.request["X-Forwarded-Host"]
index.cgi:
#! /usr/bin/perl print "Content-Type: text/plain\n\n"; for (keys %ENV) { print $_, " => ", $ENV{$_}, "\n"; }
GET -H 'X-Forwarded-Host: www.example.com' !http://172.30.0.65/cgi/index.cgi
Request result (without patch):
HTTP_HOST => 172.30.0.65
Request result (with patch):
HTTP_HOST => www.example.com
This patch is really useful (together with mod_extforward) for lighttpd servers behind reverse proxy. In this scenario proxy adds special header (ex. X-Forwarded-Host:) with original Host: value and forwards requests to lighttpd.
Some CGI applications that depends on "correct" Host: header can work without modifications.
-- kupson
Files
Updated by stbuehler about 15 years ago
I am not convinced yet that it should be writable from mod_magnet; for example you ignore the fact that the hostname is used in conditionals.
Updated by stbuehler almost 15 years ago
- Target version changed from 1.4.20 to 1.4.21
Updated by icy over 14 years ago
- Target version changed from 1.4.21 to 1.4.22
- Patch available set to Yes
Updated by stbuehler over 14 years ago
- Target version changed from 1.4.22 to 1.4.23
Updated by stbuehler over 14 years ago
- Status changed from New to Wontfix
If someone needs this feature, he has to apply that path himself. I think it is too dangerous.
And a proxy shouldn't modify the Host: header imho (unless you really want that, in which case you don't want to revert the change).
Also available in: Atom