Skip to content

Add support for flask blueprints subdomains #80

@biozz

Description

@biozz

Description

Currently it is not possible to natively use flask blueprints subdomains wildcards, because JSONRPCAPI.jsonrpc method in flask backend doesn't handle additional argument if blueprint subdomain is defined as a wildcard, i.e.

    app.register_blueprint(api.as_blueprint(), subdomain='<subdomain>')

In this way, the api can be used through api.example.com or api2.example.com or other.example.com.

Steps to Reproduce

  1. Define api endpoint
  2. Register endpoint as a blueprint with wildcard subdomain
  3. Perform call to an endpoint

Expected behavior: api can be used through registered endpoint and subdomain wildcard is available in the jsonrpc method.

Actual behavior: jsonrpc raises an exception, that it can't accept additional argument, i.e. subdomain.

Reproduces how often: always

Versions

  • Ubuntu 16.04
  • Python 3.6.3
  • nginx 1.10.3 or /etc/hosts
  • json-rpc 1.10.8

Additional Information

I can see there are multiple ways this can be solved. For now I am using a workaround to handle subdomains in the application, which involves nginx and setting some headers.
I would also like to contribute and make this possible, what are your thoughts on this feature?

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions