Opened 8 years ago
Closed 8 years ago
#12790 closed defect (cantfix)
Client cannot verify user
Reported by: | komar | Owned by: | Michiel van Loon |
---|---|---|---|
Priority: | normal | Component: | AndroidClientIntegration |
Severity: | normal | Keywords: | |
Cc: | Trac Release: |
Description
When I try verify user, I get in log:
2016-06-04 23:09:58,109 Trac[web_ui] ERROR: No protocol matching Content-Type 'application/json' at path '/login/xmlrpc'.
After I patch /usr/lib/python2.7/dist-packages/tracrpc/web_ui.py, everyting work fine:
def process_request(self, req): protocol = req.args.get('protocol', None) content_type = req.get_header('Content-Type') or 'text/html' - if protocol: + if protocol or content_type == 'application/json': # Perform the method call self.log.debug("RPC incoming request of content type '%s' " \
Attachments (0)
Change History (7)
comment:1 Changed 8 years ago by
Component: | AndroidClientIntegration → XmlRpcPlugin |
---|---|
Owner: | changed from Michiel van Loon to osimons |
comment:2 Changed 8 years ago by
I was thinking that must be fixed in AndroidClientIntegration, becouse other RPC clients working fine. Or I this must be fixed in both sides.
comment:3 Changed 8 years ago by
That patch you provided in comment:description is a patch of the XmlRpcPlugin code: xmlrpcplugin/trunk/tracrpc/web_ui.py@9970:65#L62.
comment:4 Changed 8 years ago by
Yes, becouse I know how to patch trac, but it's hard for me patch and try android app :)
comment:5 Changed 8 years ago by
I don't know the Andoid app, but if you have any way of chaning the URL to /login/rpc
instead of /login/xmlrpc
? The old deprecated URL of /xmlrpc
and /login/xmlrpc
is tied to the XML-RPC protocol and will not match when you pass a request with JSON content instead of XML.
If not you will have to request a patch for the Andoid app as I cannot use your "band-aid" patch for your very personal use-case. It conflicts with the protocol-agnostic nature of the RPC plugin, and we would need to drop our goal of 100% passing tests... ;-)
comment:6 Changed 8 years ago by
Component: | XmlRpcPlugin → AndroidClientIntegration |
---|---|
Owner: | changed from osimons to Michiel van Loon |
comment:7 Changed 8 years ago by
Resolution: | → cantfix |
---|---|
Status: | new → closed |
The Android app uses the 'standard' URI as prescribed by the XMLRPC plugin. In the app I have no control of that; I just send the URL to the TRAC server and await the response of the server and if correct the app processes the JSON reponse. I tried myself using the login/xmlrpc variant and received a incorrect protocol error which is what I would expect. The correct way to access the TRAC server from the Android app is to use the login/rpc or login/jsonrpc variant. (Or without the login if login is not required)
Please make sure to choose the correct Component when reporting defects.