r5 - 21 Feb 2005 - 21:59:46 - MattWilkieYou are here: TWiki >  Codev Web > GetUrlShouldSendPortNumber
Tags:
, create new tag

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 Action Size Date Who Comment
elsediff Netpm.diff manage 0.8 K 26 Oct 2004 - 08:56 KaoruMaeda  
Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r5 < r4 < r3 < r2 < r1 | More topic actions
 
Powered by TWiki
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 SourceForge.net Logo