Tags:
create new tag
, view all tags

Bug: IncludeDoesNotSendHostHeader

In TWiki::Net.pm

the host header is not being sent. This breaks when trying to INCLUDE a page where the IP address is insufficient to resolve to a virtual site hosted on a shared server.

  if( ! $theHeader ) {
        $theHeader = "";
    }
    my $result = '';
    my $req = "GET $theUrl HTTP/1.0\r\n$theHeader\r\n\r\n";
    my ( $iaddr, $paddr, $proto );
    $iaddr   = inet_aton( $theHost );
    $paddr   = sockaddr_in( $thePort, $iaddr );
    $proto   = getprotobyname( 'tcp' );
    unless( socket( SOCK, PF_INET, SOCK_STREAM, $proto ) ) {
        &TWiki::writeWarning( "TWiki::Net::getUrl socket: $!" );
        return "content-type: text/plain\n\nERROR: TWiki::Net::getUrl socket: $!
";
    }
    unless( connect( SOCK, $paddr ) ) {
        &TWiki::writeWarning( "TWiki::Net::getUrl connect: $!" );
        return "content-type: text/plain\n\nERROR: TWiki::Net::getUrl connect: $
!";

Test case

See: http://www.mrjc.com/twiki/bin/view/Plugins/KoalaSkin

Environment

TWiki version: Dec 2001
TWiki plugins: N/A
Server OS: Linux Redhat 7.1
Web server: Apache
Perl version: 5.7
Client OS: Win 98
Web Browser: IE 6

-- MartinCleaver - 01 May 2002

Follow up

Fix record

This is a duplicate of ProperIncludeUrls, which includes some code to fix this issue. This should really go into the core code, though.

Note that the ImplementationDate is for when the bug is actually fixed. The WebForm fields on Codev are quite confusing IMO, but I can't get anyone to comment on TWikiExtraFeatures so there's not much prospect of fixing this frown

-- RichardDonkin - 01 May 2002

Topic revision: r2 - 01 May 2002 - 07:15:53 - RichardDonkin
 
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