[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[4972] trunk/rest-handler.pl
- Subject: SF.net SVN: ledger-smb:[4972] trunk/rest-handler.pl
- From: ..hidden..
- Date: Fri, 13 Jul 2012 06:22:41 +0000
Revision: 4972
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4972&view=rev
Author: einhverfr
Date: 2012-07-13 06:22:41 +0000 (Fri, 13 Jul 2012)
Log Message:
-----------
Cleaning up error codes and changing to lower case method names
Modified Paths:
--------------
trunk/rest-handler.pl
Modified: trunk/rest-handler.pl
===================================================================
--- trunk/rest-handler.pl 2012-07-13 02:39:01 UTC (rev 4971)
+++ trunk/rest-handler.pl 2012-07-13 06:22:41 UTC (rev 4972)
@@ -190,10 +190,10 @@
} else {
- if ($classpkg->can($request->{method})){
- $classpkg->can($request->{method})->($request);
+ if ($classpkg->can(lc($request->{method}))){
+ $classpkg->can(lc($request->{method}))->($request);
} else {
- die '401 Method Not Allowed';
+ die '405 Method Not Allowed';
}
}
@@ -204,7 +204,7 @@
if ($fmtpackage->can('to_output')){
$content = $fmtpackage->can('to_output')->($request);
} else {
- return error_handler('404 Unsupported Format');
+ return error_handler('415 Unsupported Media Type');
}
}
if ($fmtpackage->can('mime_type')){
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.