diff --git a/sao/src/rpc.js b/sao/src/rpc.js index bfbce1fbb2..7c689b0d86 100644 --- a/sao/src/rpc.js +++ b/sao/src/rpc.js @@ -178,7 +178,7 @@ 'params': params })), 'dataType': 'json', - 'url': (session.database || '.') + '/#' + args.method, + 'url': (session.database || '.') + '/rpc/#' + args.method, 'type': 'post', 'complete': [function() { Sao.common.processing.hide(timeoutID); diff --git a/sao/src/session.js b/sao/src/session.js index 143612e926..bcfaca017d 100644 --- a/sao/src/session.js +++ b/sao/src/session.js @@ -189,7 +189,7 @@ 'params': [] }), 'dataType': 'json', - 'url': '.', + 'url': 'rpc/', 'type': 'post', 'complete': [function() { Sao.common.processing.hide(timeoutID); @@ -602,7 +602,7 @@ 'params': [] }), 'dataType': 'json', - 'url': '.', + 'url': 'rpc/', 'type': 'post', 'complete': [function() { Sao.common.processing.hide(timeoutID); @@ -624,7 +624,7 @@ 'params': [] }), 'dataType': 'json', - 'url': '.', + 'url': 'rpc/', 'type': 'post', 'complete': [function() { Sao.common.processing.hide(timeoutID); diff --git a/tryton/tryton/jsonrpc.py b/tryton/tryton/jsonrpc.py index b3d3c2ab3a..718f3d7f33 100644 --- a/tryton/tryton/jsonrpc.py +++ b/tryton/tryton/jsonrpc.py @@ -298,7 +298,7 @@ class ServerProxy(xmlrpc.client.ServerProxy): try: response = self.__transport.request( self.__host, - self.__handler, + self.__handler + 'rpc/', request, verbose=self.__verbose ) diff --git a/trytond/CHANGELOG b/trytond/CHANGELOG index 27b35c31f1..9b7e6722c6 100644 --- a/trytond/CHANGELOG +++ b/trytond/CHANGELOG @@ -1,3 +1,4 @@ +* Add rpc suffix to URL for RPC call * Support mounting application under a prefix * Send emails on chat messages * Add path attribute on XML fields to specfiy a relative path value diff --git a/trytond/doc/topics/rpc.rst b/trytond/doc/topics/rpc.rst index 1ad8420cc7..7fbd31ecc7 100644 --- a/trytond/doc/topics/rpc.rst +++ b/trytond/doc/topics/rpc.rst @@ -6,7 +6,7 @@ Remote Procedure Call There are two protocols supported by trytond: `JSON-RPC`_ (Version 1.0) and `XML-RPC`_. -The URL of the calls must end with the database name with a trailing '/'. +The format of the URL to call is ``/rpc/``. The available methods are: diff --git a/trytond/trytond/protocols/dispatcher.py b/trytond/trytond/protocols/dispatcher.py index 6e3e4c2071..bb2dd51e97 100644 --- a/trytond/trytond/protocols/dispatcher.py +++ b/trytond/trytond/protocols/dispatcher.py @@ -25,7 +25,7 @@ __all__ = ['register_authentication_service'] logger = logging.getLogger(__name__) -@app.route('//', methods=['POST']) +@app.route('//rpc/', methods=['POST']) def rpc(request, database_name): methods = { 'common.db.login': login, @@ -110,7 +110,7 @@ def reset_password(request, database_name, user, language=None): abort(HTTPStatus.TOO_MANY_REQUESTS) -@app.route('/', methods=['POST']) +@app.route('/rpc/', methods=['POST']) def root(request, *args): methods = { 'common.server.version': lambda *a: __series__,