Tags:
create new tag
, view all tags

Bug: TWiki::Net::getUrl should send thePort in Host: header

INCLUDEd http server cannot know the vhost port.

Suggested Patch

--- Net.pm~   2004-10-13 14:11:16.140625000 +0200
+++ Net.pm   2004-10-13 14:14:06.640625000 +0200
@@ -70,7 +70,7 @@
     my $req = "GET $theUrl HTTP/1.0\r\n";
 
     # RNF 22 Jan 2002 Support for vhosts and user authentication.
-    $req .= "Host: $theHost\r\n";
+    $req .= "Host: $theHost:$thePort\r\n";
     if( $theUser && $thePass ) {
    # Use MIME::Base64 at run-time if using outbound proxy with 
    # authentication
@@ -84,7 +84,7 @@
     my $proxyHost = &TWiki::Prefs::getPreferencesValue("PROXYHOST");
     my $proxyPort = &TWiki::Prefs::getPreferencesValue("PROXYPORT");
     if($proxyHost && $proxyPort) {
-        $req = "GET http://$theHost$theUrl HTTP/1.0\r\n";
+        $req = "GET http://$theHost:$thePort$theUrl HTTP/1.0\r\n";
         $theHost = $proxyHost;
         $thePort = $proxyPort;
     }

Test case

INCLUDing a locally set-up ZWiki produced links without proper port numbers.

Environment

TWiki version: TWikiRelease01Sep2004
TWiki plugins: (pre-installed)
Server OS: Windows XP
Web server: Apache 2.0.52 mod_perl/1.99_16
Perl version: 5.8.4
Client OS: Windows XP
Web Browser: FireFox 1.0PR

-- KaoruMaeda - 13 Oct 2004

Follow up

I changed the WebForm to PatchProposal. Also, attach the diff file.

-- KaoruMaeda - 26 Oct 2004

Fix record

Patch applied to DEVELOP codebase - rev 1784. Thanks Kaoru!

-- CrawfordCurrie - 26 Oct 2004

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatdiff Netpm.diff r1 manage 0.8 K 2004-10-26 - 08:56 KaoruMaeda  
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2005-02-21 - MattWilkie
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.