X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FActionRole%2FHTTPMethods.pm;h=a0ab7e294cf050ac4e7425b78f98a7e826764fc8;hp=4f2a0d589fb2603786bde840b34c22b659b437c9;hb=ffca3e960f527321fa30c5ffdfe6ffd2a984af59;hpb=3c0da3ece98e535f1c168bb985980583498894ad diff --git a/lib/Catalyst/ActionRole/HTTPMethods.pm b/lib/Catalyst/ActionRole/HTTPMethods.pm index 4f2a0d5..a0ab7e2 100644 --- a/lib/Catalyst/ActionRole/HTTPMethods.pm +++ b/lib/Catalyst/ActionRole/HTTPMethods.pm @@ -29,7 +29,13 @@ sub _has_expected_http_method { sub allowed_http_methods { @{shift->attributes->{Method}||[]} } -sub list_extra_info { sort shift->allowed_http_methods } +around 'list_extra_info', sub { + my ($orig, $self, @args) = @_; + return { + %{ $self->$orig(@args) }, + +{ HTTP_METHODS => [sort $self->allowed_http_methods] } + }; +}; 1; @@ -116,7 +122,9 @@ normalized as noted above (using X-Method* overrides). =head2 list_extra_info -Returns an array of the allowed HTTP Methods, sorted. +Adds a key => [@values] "HTTP_METHODS" whose value is an ArrayRef of sorted +allowed methods to the ->list_extra_info HashRef. This is used primarily for +debugging output. =head2 _has_expected_http_method ($expected)