git://git.jankratochvil.net
/
nethome.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b5a4ccf
)
+Support for XHTML "Accept" negotiations: -x
author
short
<>
Thu, 25 Aug 2005 01:02:15 +0000
(
01:02
+0000)
committer
short
<>
Thu, 25 Aug 2005 01:02:15 +0000
(
01:02
+0000)
bin/httpgetdumb
patch
|
blob
|
history
diff --git
a/bin/httpgetdumb
b/bin/httpgetdumb
index
9c6d83c
..
3a78236
100755
(executable)
--- a/
bin/httpgetdumb
+++ b/
bin/httpgetdumb
@@
-13,7
+13,7
@@
use constant DEFAULT_PORT=>80;
use constant BUFFER_LENGTH=>0x1000;
my %opts;
use constant BUFFER_LENGTH=>0x1000;
my %opts;
-getopts "hH",\%opts or die "getopts()";
+getopts "
x
hH",\%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);
@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$',
);
"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";
}
while (my($key,$val)=each(%header)) {
print SOCK "$key: $val\r\n";
}