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

Http exception cookies support #5197

Merged
merged 8 commits into from
Nov 14, 2020
Merged

Conversation

derlih
Copy link
Contributor

@derlih derlih commented Nov 3, 2020

What do these changes do?

Add methods set_cookie() an del_cookie() to HTTPException
Add cookies property to HTTPException

Are there changes in behavior for the user?

User can set the cookies for HTTPException

Related issue number

#4277

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> for example (588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the pr
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."

@derlih derlih requested a review from asvetlov as a code owner November 3, 2020 03:15
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Nov 3, 2020
@codecov
Copy link

codecov bot commented Nov 3, 2020

Codecov Report

Merging #5197 (b617eb5) into master (7ebc07a) will decrease coverage by 0.01%.
The diff coverage is 96.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5197      +/-   ##
==========================================
- Coverage   97.56%   97.54%   -0.02%     
==========================================
  Files          43       43              
  Lines        8779     8794      +15     
  Branches     1412     1413       +1     
==========================================
+ Hits         8565     8578      +13     
- Misses        100      101       +1     
- Partials      114      115       +1     
Flag Coverage Δ
unit 97.39% <96.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
aiohttp/resolver.py 93.18% <ø> (ø)
aiohttp/helpers.py 96.55% <95.23%> (-0.14%) ⬇️
aiohttp/web_exceptions.py 99.52% <100.00%> (+<0.01%) ⬆️
aiohttp/web_protocol.py 92.28% <100.00%> (+0.02%) ⬆️
aiohttp/web_response.py 98.09% <100.00%> (+0.29%) ⬆️
aiohttp/streams.py 97.43% <0.00%> (-0.49%) ⬇️

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 9bce9c2...b617eb5. Read the comment docs.

@derlih
Copy link
Contributor Author

derlih commented Nov 3, 2020

@asvetlov if this approach is OK, I will update the documentation.

@asvetlov asvetlov added the backport:skip Skip backport bot label Nov 9, 2020
Copy link
Member

@asvetlov asvetlov left a comment

Choose a reason for hiding this comment

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

Looks good.
Could you please update web_excetions.rst to reflect new methods?

@derlih
Copy link
Contributor Author

derlih commented Nov 10, 2020

What versionadded should I use to reflect these changes in documentation?

@derlih derlih requested a review from webknjaz as a code owner November 11, 2020 08:46
@asvetlov
Copy link
Member

4.0
In 3.x branch HTTPException is derived from Response, thus it has cookie methods already.
Let's add breaking changes in major releases only.

@derlih
Copy link
Contributor Author

derlih commented Nov 12, 2020

That was exactly the reason why I've raised my question. If it doesn't break the API from 3.x in theory it can be backported to 3.x.

@asvetlov
Copy link
Member

Dropping the inheritance from web.Response is not backward compatible change.

While we keep the inheritance -- there Is no need to backport this PR because web.Response already provides the cookies API

@asvetlov asvetlov merged commit 54afac7 into aio-libs:master Nov 14, 2020
@asvetlov
Copy link
Member

Thanks!

@derlih derlih deleted the HTTPException_cookies branch November 14, 2020 13:44
commonism pushed a commit to commonism/aiohttp that referenced this pull request Apr 27, 2021
commonism pushed a commit to commonism/aiohttp that referenced this pull request Apr 27, 2021
bdraco added a commit to bdraco/aiohttp that referenced this pull request Nov 27, 2023
bdraco added a commit to bdraco/aiohttp that referenced this pull request Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip Skip backport bot bot:chronographer:provided There is a change note present in this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants