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

Fix static routes registration on a blueprint #1954

Merged
merged 1 commit into from
Oct 24, 2020

Conversation

ashleysommer
Copy link
Member

Adds ability for app.static() to return the routes it created.
This allows blueprint registration to add the bp's static routes to its list of own routes.
So now blueprint middlewares will apply to a blueprint's static file routes.
Fixes #1953

This allows blueprint registration to add the bp's static routes to its list of own routes. So now blueprint middlewares will apply to a blueprint's static file routes.
Fixes sanic-org#1953
@ashleysommer ashleysommer requested a review from ahopkins October 22, 2020 23:47
@ashleysommer
Copy link
Member Author

AppVeyor is failing on test_loaded_module_from_file_location_name I don't know if thats expected, I don't think its related to changes in this PR.

uri,
methods=["GET", "HEAD"],
name=name,
host=host,
strict_slashes=strict_slashes,
)(_handler)
return _routes
Copy link

@digitalkaoz digitalkaoz Oct 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this change is not necessary

Copy link

@digitalkaoz digitalkaoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just one small cosmetic change

@ahopkins
Copy link
Member

@ashleysommer That test is broken. Looks like a problem with how it was written and is out of the scope for this PR. I am merging and ignoring that for now.

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

Successfully merging this pull request may close these issues.

Decorators not applied to Static Files
3 participants