in reply to LWP not returning leading spaces in web page (ver 2)

Using the fake web server code from the Perl cookbook (p691) I compared the request headers for the 2 methods. Here are the results
GET /index.htm HTTP/1.1 Connection: TE, close Host: localhost:8989 TE: deflate,gzip;q=0.3 User-Agent: libwww-perl/5.69 GET /index.htm HTTP/1.1 Cache-Control: no-cache Pragma: no-cache Accept: text/*, image/jpeg, image/png, image/*, */* Accept-Charset: iso-8859-1, utf-8;q=0.5, *;q=0.5 Accept-Encoding: x-gzip, gzip, identity Accept-Language: en Host: localhost:8989 User-Agent: Mozilla/5.0 (compatible; Konqueror/3; Linux)
I'm no expert but I suspect it is something to do with the Transfer-Encoding and/or output-filtering caused by the way Apache is configured. I noticed wwww.yahoo.com has no leading spaces even in the browser.
poj

Replies are listed 'Best First'.
Re:^2 LWP not returning leading spaces in web page (ver 2)
by aspen (Sexton) on Feb 01, 2003 at 20:36 UTC

    Interesting. I've tried modifying my LWP request to include all the headers you've shown but am still not receiving the leadings spaces.

    I'm not sure where the LWP headers you show as "TE:" and "Connection:" are being inserted. I didn't think LWP would add these headers, but I could be wrong. I need to try out the fake web server code and experiment more.

    Bottom line right now is, if anyone has other ideas I'd appreciate them.

    Andy

    @_="the journeyman larry disciple keeps learning\n"=~/(.)/gs, print(map$_[$_-77],unpack(q=c*=,q@QSdM[]uRMNV^[ni_\[N]eki^y@))
      Here is the server code I used
      #!/usr/bin/perl -w use strict; use HTTP::Daemon; my $server=HTTP::Daemon->new(Timeout => 10, LocalPort => 8989); while (my $client = $server->accept){ CONNECTION: while (my $answer = $client->get_request){ print $answer->as_string; open LOG,">>weblog.txt"; print LOG $answer->as_string;; close LOG; $client->autoflush; RESPONSE: while (<STDIN>) { last REPONSE if $_ eq ".\n"; last CONNECTION if $_ eq "..\n"; print $client $_; } print "\nEOF\n"; } print "CLOSE: ",$client->reason,"\n"; $client->close; undef $client; }
      poj