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

Don't create a new resource with allow_head=True #2585

Merged
merged 2 commits into from
Dec 4, 2017
Merged

Don't create a new resource with allow_head=True #2585

merged 2 commits into from
Dec 4, 2017

Conversation

asvetlov
Copy link
Member

@asvetlov asvetlov commented Dec 3, 2017

Backward incompatible but I believe almost nobody is affected.

@@ -0,0 +1 @@
Do not create a new resource on `router.add_get(..., allow_head=True)`
Copy link
Member

Choose a reason for hiding this comment

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

I guess it's improvement, not removal.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's both optimization and breaking change: in aiohttp 2.x the call router.add_get('/', handler, name='name') adds two named resources: name for GET and name-head for HEAD.
But both resources are identical.

After PR merging I want add generic optimization for sequential add_route() calls if created resource is the same.

router.add_get('/', ...)
router.add_post('/', ...)

should create the single resource if path and name are the same.

@codecov-io
Copy link

codecov-io commented Dec 3, 2017

Codecov Report

Merging #2585 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2585   +/-   ##
=======================================
  Coverage   97.71%   97.71%           
=======================================
  Files          36       36           
  Lines        7229     7229           
  Branches     1262     1262           
=======================================
  Hits         7064     7064           
  Misses         58       58           
  Partials      107      107
Impacted Files Coverage Δ
aiohttp/web_urldispatcher.py 99.49% <100%> (ø) ⬆️

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 3ed3c9c...8cdcf7e. Read the comment docs.

@asvetlov asvetlov merged commit e0bb501 into master Dec 4, 2017
@asvetlov asvetlov deleted the add_get branch December 4, 2017 09:50
@lock
Copy link

lock bot commented Oct 28, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs.
If you feel like there's important points made in this discussion, please include those exceprts into that [new issue].
[new issue]: https://github.com/aio-libs/aiohttp/issues/new

@lock lock bot added the outdated label Oct 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 28, 2019
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Oct 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bot:chronographer:provided There is a change note present in this PR outdated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants