Skip to content

Commit cda09b8

Browse files
committed
Merge pull request #117 from nabsul/master
Throw error if an unknow HTTP method is used
2 parents b9e71b7 + fcde078 commit cda09b8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/class-wp-rest-oauth1.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,10 @@ protected function check_oauth_signature( $consumer, $oauth_params, $token = nul
649649
case 'PUT':
650650
$params = wp_unslash( $_POST );
651651
break;
652+
default:
653+
return new WP_Error( 'rest_oauth1_unknown_http_method',
654+
sprintf( __( 'Unknown http method: %s', 'rest_oauth1' ), $http_method ),
655+
array( 'status' => 401 ) );
652656
}
653657

654658
$params = array_merge( $params, $oauth_params );

0 commit comments

Comments
 (0)