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


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

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2002-05-01 - RichardDonkin
  • 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-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.