in reply to WWW::Mechanize treading lightly

How can you make _any_ decision based upon the extension of the url?!?!? Any of these (and many others) could produce html .. you really need to look for the Content-Type.
http://perlmonks.org/?parent=565470;node_id=3333 http://example.com http://example.com/blah.html http://example.com/blah.foo http://example.com/blah.htm http://example.com/blah.php http://example.com/blah.cgi http://example.com/blah.pl http://example.com/blah.asp http://example.com/blah/foo/ http://example.com/blah.exe # even this, if someone so configured + the web server

Replies are listed 'Best First'.
Re^2: WWW::Mechanize treading lightly
by andyford (Curate) on Aug 03, 2006 at 16:22 UTC
    Right, but I was thinking that you could at least drop .mp3, .gif, .jpeg just for an easy first cut, no?
      That is exactly what I was thinking. Anyone who has their webserver configured to spit out HTML from .jpg extensions isn't a site I want to bother with. Extensions serve a purpose, and while they can be abused, that abuse would negate my need to see their text. Thanks for the input.