種別[software] cocolog:10125918
セクションJRF のソフトウェア Tips
日時2006年02月21日 04:31:05
元URLhttp://jrf.cocolog-nifty.com/software/2006/02/post_15.html
タグ[Perl] [HTML/XML/CSS]

lwp-request のオプション -m を忘れて http://www.GET.com が表示されていた

さっき気付いた。ここに載っていた 'lwp-request GET' をそのまま使うと、何か変な HTML データが先に表示される。よく見ると、'lwp-request -m GET' じゃないとダメだった。

参考に次のような感じになる。

$ /usr/bin/lwp-request GET | head
<html>
<head>
<title>Great Eastern Technology - Sun, Silicon Graphics, SGI, Sales, Repair, Maintenance and Alias/Wavefront 3D Animation and Graphics</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META name="keywords" value="Sun, Sun Microsystems, Sun Microsystems, SGI, Silicon Graphics, SGI
Maintenance, Silicon Graphics Maintenance, Sell,
Buy, Repair, Support, Maintenance Contract,
Refurbished SGI, Rapid Prototyping, Rapid Prototype, ZCorp Printer, Alias, Alias/Wavefront, Maya, 3D
Software, Network Services, System Integration,
SGI Maintenance Training, Animation Software, 

lwp-request 内で URI::Heuristic::uf_uri を使って GET を http://www.GET.com に展開しているため、このようなことが起きている。

さすがに GET を展開するのは、いくらなんでも要らんだろう。

更新:06/02/21
初公開:2006年02月21日 04:29:27