Merge branch 'klkanet push origin master-master'
[catagits/Catalyst-Action-REST.git] / lib / Catalyst / Action / SerializeBase.pm
index a72a467..b901f61 100644 (file)
@@ -8,9 +8,6 @@ use Module::Pluggable::Object;
 use Catalyst::Request::REST;
 use Catalyst::Utils ();
 
-our $VERSION = '1.07';
-$VERSION = eval $VERSION;
-
 after BUILDARGS => sub {
     my $class  = shift;
     my $config = shift;
@@ -121,10 +118,12 @@ sub _load_content_plugins {
     }
 
     if ($search_path eq "Catalyst::Action::Serialize") {
-        if ($content_type) {
-            $c->response->header( 'Vary' => 'Content-Type' );
-        } elsif ($c->request->accept_only) {
-            $c->response->header( 'Vary' => 'Accept' );
+        unless( $c->response->header( 'Vary' ) ) {
+            if ($content_type) {
+                $c->response->header( 'Vary' => 'Content-Type' );
+            } elsif ($c->request->accept_only) {
+                $c->response->header( 'Vary' => 'Accept' );
+            }
         }
         $c->response->content_type($content_type);
     }