Project

General

Profile

Actions

Feature #1749

closed

Make lighty.request fully writable in mod_magnet

Added by Anonymous almost 13 years ago. Updated almost 12 years ago.

Status:
Wontfix
Priority:
Normal
Category:
mod_magnet
Target version:
ASK QUESTIONS IN Forums:

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

Actions #1

Updated by stbuehler over 12 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.

Actions #2

Updated by stbuehler over 12 years ago

  • Target version changed from 1.4.20 to 1.4.21
Actions #3

Updated by icy over 12 years ago

  • Target version changed from 1.4.21 to 1.4.22
  • Patch available set to Yes
Actions #4

Updated by stbuehler about 12 years ago

  • Target version changed from 1.4.22 to 1.4.23
Actions #5

Updated by stbuehler almost 12 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).

Actions

Also available in: Atom