Author: jsdelfino
Date: Wed Sep 15 05:08:17 2010
New Revision: 997187
URL: http://svn.apache.org/viewvc?rev=997187&view=rev
Log:
Accept JSON-RPC requests with application/x-www-form-urlencoded content type.
Modified:
tuscany/sca-cpp/trunk/modules/server/mod-eval.hpp
tuscany/sca-cpp/trunk/modules/wsgi/composite.py
Modified: tuscany/sca-cpp/trunk/modules/server/mod-eval.hpp
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/server/mod-eval.hpp?rev=997187&r1=997186&r2=997187&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/mod-eval.hpp (original)
+++ tuscany/sca-cpp/trunk/modules/server/mod-eval.hpp Wed Sep 15 05:08:17 2010
@@ -149,7 +149,7 @@ const failable<int> post(request_rec* r,
// Evaluate a JSON-RPC request and return a JSON result
const string ct = httpd::contentType(r);
- if (contains(ct, "application/json-rpc") || contains(ct, "text/plain")) {
+ if (contains(ct, "application/json-rpc") || contains(ct, "text/plain") ||
contains(ct, "application/x-www-form-urlencoded")) {
// Read the JSON request
const int rc = httpd::setupReadPolicy(r);
Modified: tuscany/sca-cpp/trunk/modules/wsgi/composite.py
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/wsgi/composite.py?rev=997187&r1=997186&r2=997187&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/wsgi/composite.py (original)
+++ tuscany/sca-cpp/trunk/modules/wsgi/composite.py Wed Sep 15 05:08:17 2010
@@ -190,7 +190,7 @@ def application(e, r):
ct = requestContentType(e)
# Handle a JSON-RPC function call
- if ct.find("application/json-rpc") != -1 or ct.find("text/plain") !=
-1:
+ if ct.find("application/json-rpc") != -1 or ct.find("text/plain") !=
-1 or ct.find("application/x-www-form-urlencoded") != -1:
json = elementsToValues(readJSON(requestBody(e)))
args = postArgs(json)
jid = cadr(assoc("'id", args))