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

Patch default strict slashes #900

Merged
merged 4 commits into from
Aug 21, 2017
Merged

Patch default strict slashes #900

merged 4 commits into from
Aug 21, 2017

Conversation

yunstanford
Copy link
Member

Fix #897

@@ -111,7 +112,7 @@ def decorator(listener):

# Decorator
def route(self, uri, methods=frozenset({'GET'}), host=None,
strict_slashes=False, stream=False, version=None):
strict_slashes=None, stream=False, version=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of strict_slashes=None I think it's better to do strict_slashes=self.strict_slashes since it's more compact. What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

self is not available at that moment i think.

Copy link
Contributor

@r0fls r0fls Aug 21, 2017

Choose a reason for hiding this comment

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

I understand your doubt but it seemed to work here: #896. I did the same type of thing a couple days ago when I made that, so should work :)

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, it works in your case, because that is inside def route(self, ...), self is available then.

def route(self, ...):
   # blablabla
   self.router.add(..., merge_routes=self.merge_routes)

Correct me if i am looking at wrong place.

Copy link
Contributor

Choose a reason for hiding this comment

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

🤕 derp, good call

@@ -111,7 +112,7 @@ def decorator(listener):

# Decorator
def route(self, uri, methods=frozenset({'GET'}), host=None,
strict_slashes=False, stream=False, version=None):
strict_slashes=None, stream=False, version=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

🤕 derp, good call

@r0fls
Copy link
Contributor

r0fls commented Aug 21, 2017

Nice work, once again. Thanks for the help!

@r0fls
Copy link
Contributor

r0fls commented Aug 21, 2017

@yunstanford final thing -- can you add this to the docs? Just a quick mention is all that's needed.

@r0fls r0fls merged commit fa1a95a into sanic-org:master Aug 21, 2017
@seemethere seemethere added this to the 0.6.1 milestone Oct 13, 2017
@seemethere seemethere modified the milestones: 0.6.1, 0.7.0 Nov 13, 2017
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.

3 participants