Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incompatible with http.headers 'Content-Type':'application/json-prc' #222

Closed
hualongsd opened this issue May 11, 2022 · 5 comments
Closed
Assignees

Comments

@hualongsd
Copy link
Contributor

Hello, some languages' jsonrpc toolkit specific that 'Content-Type':'application/json-prc'. For example, the JsonRpcBasicServer.java for java. But, now the flask-jsonrpc don't support 'Content-Type':'application/json-prc'.
Could you change the FUNC is_json() in /src/site.py line 95? So that make it compatible with java's jsonrpc tool, and support 'Content-Type':'application/json-prc'.

@nycholas
Copy link
Member

Hi @hualongsd,

It is a very strange Content-Type to JSON-RPC, but I think we can put this configuration on set up of JSON-RPC:

from flask import Flask
from flask_jsonrpc import JSONRPC

app = Flask("application")
jsonrpc = JSONRPC(app, "/api", enable_web_browsable_api=True, headers_allow_list={'Accept': 'application/json-rpc'})

Something like that. I will evaluate that.

Thank you.

@hualongsd
Copy link
Contributor Author

Hello nycholas,

Thank you for your prompt reply.

And thank you for your willingness to help solve my problem. I'm looking forward to the new version being 'application/json-rpc' compatible.

Have a good day.

@nycholas
Copy link
Member

@hualongsd I will release a new version this weekend with these modifications.

Thank you.

nycholas added a commit that referenced this issue May 13, 2022
* Additional HTTP Headers for JSON-RPC Over HTTP (#222)
@nycholas
Copy link
Member

@hualongsd version 2.2.1[1] was released with its changes, thank you for your contribution.

[1] - https://pypi.org/project/Flask-JSONRPC/2.2.1/

@hualongsd
Copy link
Contributor Author

Hello nycholas,

Well noted.

Thank you very much for dealing with this problem so efficiently. That helps me to deliver my work on time.

Have a good weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants