-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Using list with host parameter in blueprint.route() does not work. #1772
Labels
Comments
damianj
changed the title
Using list with host argument in blueprint.route() does not work.
Using list with host parameter in blueprint.route() does not work.
Jan 26, 2020
damianj
added a commit
to damianj/sanic
that referenced
this issue
Jan 30, 2020
As explained in sanic-org#1772 there is an issue when using a list as an argument for the host parameter in the Blueprint.route() decorator. I've traced the issue back to this line, and the if conditional should ensure that the name attribute isn't accessed when route is None.
I've opened #1776 to address this issue. |
Thanks for bringing this up. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is incorrect, please respond with an update. Thank you for your contributions. |
ahopkins
added a commit
that referenced
this issue
Jun 28, 2020
* Bug fix for host parameter issue with lists As explained in #1772 there is an issue when using a list as an argument for the host parameter in the Blueprint.route() decorator. I've traced the issue back to this line, and the if conditional should ensure that the name attribute isn't accessed when route is None. * Unit tests for blueprint.route host paramter set to list. Co-authored-by: Adam Hopkins <[email protected]>
@ahopkins @ashleysommer probably we should close the issue since we already merged PR with a fix. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
As the title implies, when I try to set the host parameter to a list on a blueprint route, the app does not start and instead gives an error like:
Code snippet
To reproduce that error:
Note that if host is set to a string (i.e.,
@child_bp.route('/', host="127.0.0.1:8000")
) or it's not even specified in the route (i.e.,@child_bp.route('/')
) then the app runs just fine.Expected behavior
I would expect that the host parameter would function similar to that described in https://sanic.readthedocs.io/en/latest/sanic/routing.html#http-request-types
Environment (please complete the following information):
Additional context
This was working previously so I don't know if it's a bug or some intentional change in functionality.
The text was updated successfully, but these errors were encountered: