From: adam Date: Tue, 5 Dec 2006 20:58:52 +0000 (+0000) Subject: Made the YAML::HTML view automatically append the content-type to it's URLs, since... X-Git-Tag: 0.67_01~52 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a621925a32cd4036a1a864a0a373d4852ead9b34;hp=6646fdc27add35e5421e516b1fcd98560bef0b96;p=catagits%2FCatalyst-Action-REST.git Made the YAML::HTML view automatically append the content-type to it's URLs, since it's only real usefulness is in a browser. --- diff --git a/Changelog b/Changelog index 9252865..50b4f81 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,7 @@ +Tue Dec 5 13:02:08 PST 2006 (adam) + Made the YAML::HTML view automatically append content-type=text/html on + the resulting URLs. + Sun Dec 3 12:24:16 PST 2006 (adam) - Release 0.30 Updated the Makefile to support optional installation of the different Serialization formats. diff --git a/lib/Catalyst/Action/Serialize/YAML/HTML.pm b/lib/Catalyst/Action/Serialize/YAML/HTML.pm index 93a95d3..54791b4 100644 --- a/lib/Catalyst/Action/Serialize/YAML/HTML.pm +++ b/lib/Catalyst/Action/Serialize/YAML/HTML.pm @@ -28,7 +28,13 @@ sub execute { my $finder = URI::Find->new( sub { my($uri, $orig_uri) = @_; - return qq|$orig_uri|; + my $newuri; + if ($uri =~ /?/) { + $newuri = $uri . "&content-type=text/html"; + } else { + $newuri = $uri . "?content-type=text/html"; + } + return qq|$orig_uri|; }); $finder->find(\$text); $output .= $text;