We relaunched the TWiki.org project with an expanded TWiki charter, and we invite you to participate! The TWiki.org Code of Conduct agreement took effect on 27 Oct 2008. We ask existing twiki.org users to opt-in. You need to opt-in to participate in the Blog, Codev, Plugins and TWiki webs. -- PeterThoeny - 27 Oct 2008
You are here: TWiki> Codev Web>HttpRequestAndVirtualHosts (05 Feb 2004, PeterThoeny)
Tags:
create new tag
, view all tags

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 smile . 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

Topic attachments
I Attachment Action Size Date Who Comment
elsepatch http1.1-query.patch manage 0.6 K 15 May 2002 - 08:33 NicolasDuboc Converts http/1.0 wiki requests to http/1.1
Topic revision: r9 - 05 Feb 2004 - 06:33:34 - PeterThoeny
 
TWIKI.NET
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback