Bug: Http Requests And Virtual Hosts
%ATTACHURL% directives are handled by a HTTP/1.0 request to the
web server. But when this server is a Virtual Host server, the
lack of the Host header in the http query produces a 404 error.
I made a patch to convert http/1.0 TWiki requests to http/1.1.
http1.1-query.patch
The same modifications must be applied to the
bin/geturl script.
Test case
Try a
[%ATTACHURL%/an_attachement] on a twiki hosted in
a virtual host web server.
Environment
| TWiki version: |
Rel. 01 Dec 2001 |
| TWiki plugins: |
|
| Server OS: |
GNU/Linux |
| Web server: |
Apache |
| Perl version: |
|
| Client OS: |
|
| Web Browser: |
|
--
NicolasDuboc - 15 May 2002
Follow up
Fix record
Fixed, in
TWikiAlphaRelease and TWiki.org.
--
PeterThoeny - 15 Jun 2002
Good to see this in the Alpha! There was a similar patch at
ProperIncludeUrls that also addressed authentication to a proxy for such outbound-from-server HTTP transactions.
--
RichardDonkin - 15 Jun 2002
I realized that after I made the code change

. Yes, that patch should be applied too.
--
PeterThoeny - 15 Jun 2002
I just found an issue with this change: The geturl does strange things. It takes a very long time to fetch a page; and the page contains strange lines of code like this:
div#sidebartext a:hover { color: #FF3300; text-decoration: underline; }
p.sidebartext { color: #FFFFFF; }
li.sidebartext { color
2000
: #FFFFFF; }
th.sidebartext { color: #999999; }
td.sidebartext { color: #666666; }
h1.sidebartext { color: #669900; background-color: #0C2577 }
There is an extra line (like the "2000" indicated in red) in every 60 to 120 lines.
It works normally if I revert
HTTP/1.1 back to
HTTP/1.0, but that probably breaks the virtual host support?
--
PeterThoeny - 29 Jan 2004
No it doesn't. The geturl code is bust since it doesn't handle HTTP/1.1 responses but is declaring to the server that it DOES.
The "2000" numbers you're seeing are a part of
ChunkedTransferEncoding This is something that
RFC 2616 HTTP 1.1 clients MUST support (in RFC and practicality terms) IF they declare to the server that the client can handle HTTP 1.1 responses.
-- MS - 29 Jan 2004
Thank you for the clarification.
--
PeterThoeny - 29 Jan 2004
Reverted this simple utility back to HTTP 1.0.
--
PeterThoeny - 05 Feb 2004