X-Git-Url: https://git.jankratochvil.net/?p=nethome.git;a=blobdiff_plain;f=bin%2Fhttpgetdumb;h=3a782369f9d1e992c02b2da23dca16f18c19d8bd;hp=9c6d83cfee642090fd5b3fe7c773ffe1313548e8;hb=a40418bcd19ae6173e4e96c117247c14211eec0f;hpb=a4096eefa2f338e0a6e3b32e77f140291503ab4b diff --git a/bin/httpgetdumb b/bin/httpgetdumb index 9c6d83c..3a78236 100755 --- a/bin/httpgetdumb +++ b/bin/httpgetdumb @@ -13,7 +13,7 @@ use constant DEFAULT_PORT=>80; use constant BUFFER_LENGTH=>0x1000; my %opts; -getopts "hH",\%opts or die "getopts()"; +getopts "xhH",\%opts or die "getopts()"; @ARGV==1 && $ARGV[0]=~m#^http://(([^/:]+)(?::(\d+))?)(/.*)$# or die "Syntax: $0 [-hH] http://hostname/pathname"; my($hostport,$host,$port,$path)=($1,$2,$3,$4); @@ -30,6 +30,7 @@ my %header=( "Host"=>$hostport, "X-httpgetdumb"=>'$Id$', ); +$header{"Accept"}="application/xhtml+xml" if $opts{"x"}; while (my($key,$val)=each(%header)) { print SOCK "$key: $val\r\n"; }