summary refs log tree commit diff
path: root/lib/Net
diff options
context:
space:
mode:
authorAsh Berlin <ash_github@firemirror.com>2013-04-18 14:09:55 +0100
committerAsh Berlin <ash_github@firemirror.com>2013-04-18 14:09:55 +0100
commite0ad6bfc02f7d69d14fc78fff25031dd44f7f583 (patch)
tree5c2c61f9b21e386ed758c8b9ce9d6d830c1b8126 /lib/Net
parentClarifies that new_from_string expects a string in JSON format. (diff)
parentFix an error string, add a crude test (diff)
downloadnet-http-spore-e0ad6bfc02f7d69d14fc78fff25031dd44f7f583.tar.gz
Merge branch 'method-patch' of git://github.com/omega/net-http-spore into omega-method-patch
Diffstat (limited to 'lib/Net')
-rw-r--r--lib/Net/HTTP/Spore/Meta/Method.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Net/HTTP/Spore/Meta/Method.pm b/lib/Net/HTTP/Spore/Meta/Method.pm
index b3a0c6a..1a04eca 100644
--- a/lib/Net/HTTP/Spore/Meta/Method.pm
+++ b/lib/Net/HTTP/Spore/Meta/Method.pm
@@ -17,7 +17,7 @@ subtype UriPath
     => where { $_ =~ m!^/! }
     => message {"path must start with /"};
 
-enum Method => qw(OPTIONS HEAD GET POST PUT DELETE TRACE);
+enum Method => qw(OPTIONS HEAD GET POST PUT DELETE TRACE PATCH);
 
 subtype 'JSON::XS::Boolean' => as 'JSON::XS::Boolean';
 subtype 'JSON::PP::Boolean' => as 'JSON::PP::Boolean';
@@ -145,10 +145,10 @@ sub wrap {
           : delete $method_args{payload};
 
         if ( $payload
-            && ( $method->method !~ /^P(?:OS|U)T$/i ) )
+            && ( $method->method !~ /^(?:POST|PUT|PATCH)$/i ) )
         {
             die Net::HTTP::Spore::Response->new( 599, [],
-                { error => "payload requires a PUT or POST method" },
+                { error => "payload requires a PUT, PATCH or POST method" },
             );
         }