details: https://code.tryton.org/tryton/commit/bf5a02b5446c
branch: default
user: Cédric Krier <[email protected]>
date: Sun Nov 12 23:43:19 2023 +0100
description:
Add rpc suffix to URL for RPC call
diffstat:
sao/src/rpc.js | 2 +-
sao/src/session.js | 6 +++---
tryton/tryton/jsonrpc.py | 2 +-
trytond/CHANGELOG | 1 +
trytond/doc/topics/rpc.rst | 2 +-
trytond/trytond/protocols/dispatcher.py | 4 ++--
6 files changed, 9 insertions(+), 8 deletions(-)
diffs (95 lines):
diff -r 3d8b08b73281 -r bf5a02b5446c sao/src/rpc.js
--- a/sao/src/rpc.js Sun Nov 12 20:43:00 2023 +0100
+++ b/sao/src/rpc.js Sun Nov 12 23:43:19 2023 +0100
@@ -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 -r 3d8b08b73281 -r bf5a02b5446c sao/src/session.js
--- a/sao/src/session.js Sun Nov 12 20:43:00 2023 +0100
+++ b/sao/src/session.js Sun Nov 12 23:43:19 2023 +0100
@@ -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 -r 3d8b08b73281 -r bf5a02b5446c tryton/tryton/jsonrpc.py
--- a/tryton/tryton/jsonrpc.py Sun Nov 12 20:43:00 2023 +0100
+++ b/tryton/tryton/jsonrpc.py Sun Nov 12 23:43:19 2023 +0100
@@ -298,7 +298,7 @@
try:
response = self.__transport.request(
self.__host,
- self.__handler,
+ self.__handler + 'rpc/',
request,
verbose=self.__verbose
)
diff -r 3d8b08b73281 -r bf5a02b5446c trytond/CHANGELOG
--- a/trytond/CHANGELOG Sun Nov 12 20:43:00 2023 +0100
+++ b/trytond/CHANGELOG Sun Nov 12 23:43:19 2023 +0100
@@ -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 -r 3d8b08b73281 -r bf5a02b5446c trytond/doc/topics/rpc.rst
--- a/trytond/doc/topics/rpc.rst Sun Nov 12 20:43:00 2023 +0100
+++ b/trytond/doc/topics/rpc.rst Sun Nov 12 23:43:19 2023 +0100
@@ -6,7 +6,7 @@
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 ``<database name>/rpc/``.
The available methods are:
diff -r 3d8b08b73281 -r bf5a02b5446c trytond/trytond/protocols/dispatcher.py
--- a/trytond/trytond/protocols/dispatcher.py Sun Nov 12 20:43:00 2023 +0100
+++ b/trytond/trytond/protocols/dispatcher.py Sun Nov 12 23:43:19 2023 +0100
@@ -25,7 +25,7 @@
logger = logging.getLogger(__name__)
[email protected]('/<string:database_name>/', methods=['POST'])
[email protected]('/<string:database_name>/rpc/', methods=['POST'])
def rpc(request, database_name):
methods = {
'common.db.login': login,
@@ -110,7 +110,7 @@
abort(HTTPStatus.TOO_MANY_REQUESTS)
[email protected]('/', methods=['POST'])
[email protected]('/rpc/', methods=['POST'])
def root(request, *args):
methods = {
'common.server.version': lambda *a: __series__,