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

add handler name to request as endpoint #1445

Merged
merged 4 commits into from Jan 9, 2019
Merged

add handler name to request as endpoint #1445

merged 4 commits into from Jan 9, 2019

Conversation

ahopkins
Copy link
Member

This PR replaces #979 which implements #977.

@codecov
Copy link

codecov bot commented Dec 31, 2018

Codecov Report

Merging #1445 into master will increase coverage by 0.1%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #1445     +/-   ##
=========================================
+ Coverage   91.32%   91.43%   +0.1%     
=========================================
  Files          17       17             
  Lines        1718     1728     +10     
  Branches      322      324      +2     
=========================================
+ Hits         1569     1580     +11     
  Misses        123      123             
+ Partials       26       25      -1
Impacted Files Coverage Δ
sanic/request.py 99.51% <100%> (ø) ⬆️
sanic/app.py 91.64% <100%> (+0.18%) ⬆️
sanic/router.py 95.89% <0%> (+0.45%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ff38a3c...4d52703. Read the comment docs.

@@ -454,6 +454,13 @@ def websocket(
def response(handler):
async def websocket_handler(request, *args, **kwargs):
request.app = self
if not getattr(handler, "__blueprintname__", False):
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe these two if/else chunks can be refactored into a method?

Copy link
Contributor

Choose a reason for hiding this comment

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

I actually like the if/else for clarity of reading. I think it's a simple enough logic branch that it doesn't necessarily require moving it to its own method... with that being said, perhaps it's worth revisiting if we do end up adding more complexity here.

Copy link
Contributor

Choose a reason for hiding this comment

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

@sjsadowski Looking back at the comment, I see how my message was a bit confusing. I suggested the refactoring because we can re-use what we do in and around line#457 and carry it over to line#898

sanic/request.py Show resolved Hide resolved
@seemethere seemethere merged commit 2af229e into master Jan 9, 2019
@ahopkins ahopkins deleted the r0fls-977 branch January 9, 2019 18:43
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.

None yet

5 participants