[aur-dev] [PATCH 1/5] rpc.php: Allow POST method in RPC interface
Marcel Korpel
marcel.korpel at gmail.com
Mon Jul 20 22:08:44 UTC 2015
Signed-off-by: Marcel Korpel <marcel.korpel at gmail.com>
---
web/html/rpc.php | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/web/html/rpc.php b/web/html/rpc.php
index 415dcb8..aa1a562 100644
--- a/web/html/rpc.php
+++ b/web/html/rpc.php
@@ -2,7 +2,7 @@
set_include_path(get_include_path() . PATH_SEPARATOR . '../lib');
include_once("aurjson.class.php");
-if ( $_SERVER['REQUEST_METHOD'] != 'GET' ) {
+if ( $_SERVER['REQUEST_METHOD'] != 'GET' && $_SERVER['REQUEST_METHOD'] != 'POST' ) {
header('HTTP/1.1 405 Method Not Allowed');
exit();
}
@@ -10,6 +10,9 @@ if ( $_SERVER['REQUEST_METHOD'] != 'GET' ) {
if ( isset($_GET['type']) ) {
$rpc_o = new AurJSON();
echo $rpc_o->handle($_GET);
+} elseif ( isset($_POST['type']) ) {
+ $rpc_o = new AurJSON();
+ echo $rpc_o->handle($_POST);
}
else {
// dump a simple usage output for people to use.
--
2.4.6
More information about the aur-dev
mailing list