Made the YAML::HTML view automatically append the content-type to it's URLs, since...
adam [Tue, 5 Dec 2006 20:58:52 +0000 (20:58 +0000)]
Changelog
lib/Catalyst/Action/Serialize/YAML/HTML.pm

index 9252865..50b4f81 100644 (file)
--- 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.
index 93a95d3..54791b4 100644 (file)
@@ -28,7 +28,13 @@ sub execute {
     my $finder = URI::Find->new(
                               sub {
                                   my($uri, $orig_uri) = @_;
-                                  return qq|<a href="$uri">$orig_uri</a>|;
+                                  my $newuri;
+                                  if ($uri =~ /?/) {
+                                      $newuri = $uri . "&content-type=text/html";
+                                  } else {
+                                      $newuri = $uri . "?content-type=text/html";
+                                  }
+                                  return qq|<a href="$newuri">$orig_uri</a>|;
                               });
     $finder->find(\$text);
     $output .= $text;