Includes of remote pages using includes fail
Using a proxy with TWiki fails.
- It doesn't send a proxy-HTTP request.
- It claims to send an HTTP 1.1 request, but fails to send a suitable minimal 1.0 request
- All requests are marked 1.1 compliant but are in fact at best 1.0 compliant
This request is sent:
- my $req = "GET $theUrl HTTP/1.1\r\n";
But the HTTP/1.1 spec requires
the inclusion of a
header. Downgrading this to:
+ my $req = "GET $theUrl HTTP/1.0\r\n";
Results in a minimal valid HTTP/1.0 request. Given responses for 1.1 could be chunked encoding etc, which TWiki does not handle it is more appropriate in this case to downgrade the request - most webservers will do so anyway.
The request is however totally invalid for a web proxy - an explicit web proxy expects a request of the form:
+ $req = "GET http://$theHost$theUrl HTTP/1.0\r\n";
Also this needs to be done before
the host is added to the request, and any authentication tokens are added.
The attached patch fixes these issues. I suspect based on the small code review though that there might be further issues with this code.
- 09 Jul 2003
I originally set this bug to BugResolved
, since the fix is available below. I've changed this to BugAssigned
since it's not checked in (obviously).
An alternate description with an alterante implementation is at: ProxyUsing
. A minor change from that bug fix needs to be merged with this bug fix. Unless these changes are made, TWiki's proxy support is broken beyond use.
- 20 Jul 2003
I've applied this fix into CVS. A couple of small changes that make a big difference. In my testing using Apache 2.0 configured as a proxy the patch got the functionality working. Similarly the change to HTTP 1.0 made includes of HTTP work.
- 28 Sep 2003
Can anyone test this fix to see if it works with virtual hosts? Virtual hosts seem to require HTTP/1.1. See related topics:
- 30 Sep 2003
I installed this a couple of months ago. It works reliably, accessing both standalone and virtual hosts.
- 01 Oct 2003
Great, thanks Martin for the clarification. This bug is closed now.
- 30 Sep 2003