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

Auth on redirect #2328

Merged
merged 7 commits into from
Oct 16, 2017
Merged

Auth on redirect #2328

merged 7 commits into from
Oct 16, 2017

Conversation

asvetlov
Copy link
Member

Fix for #1699

@codecov-io
Copy link

codecov-io commented Oct 16, 2017

Codecov Report

Merging #2328 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2328      +/-   ##
==========================================
+ Coverage   97.24%   97.24%   +<.01%     
==========================================
  Files          39       39              
  Lines        8209     8217       +8     
  Branches     1437     1440       +3     
==========================================
+ Hits         7983     7991       +8     
  Misses         98       98              
  Partials      128      128
Impacted Files Coverage Δ
aiohttp/helpers.py 97.27% <100%> (ø) ⬆️
tests/autobahn/client.py 95.55% <0%> (+0.1%) ⬆️

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 214d02a...69139b8. Read the comment docs.

Copy link
Member

@fafhrd91 fafhrd91 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, but you should not rely on my review, someone else should review

@fafhrd91 fafhrd91 requested a review from kxepal October 16, 2017 16:58
@asvetlov
Copy link
Member Author

Committers, I need a review of the issue.
Sure, I can merge it without approval (I'm an admin btw) but I like other eyes on it

@asvetlov
Copy link
Member Author

Waiting for tomorrow

if (headers is not None and
auth is not None and
hdrs.AUTHORIZATION in headers):
raise ValueError("Cannot combine AUTHORIZATION header "
Copy link
Member

Choose a reason for hiding this comment

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

Can we have tests which triggers these ValueError's? I'm hardly imagine the case for them.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, the PR has a test for the case

Copy link
Member

Choose a reason for hiding this comment

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

Hm...seems it's slipped away from me. Ok.

@@ -322,6 +331,10 @@ def _request(self, method, url, *,
elif not scheme:
r_url = url.join(r_url)

if url.origin() != r_url.origin():
Copy link
Member

Choose a reason for hiding this comment

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

Side note: it seems like relative Location is legit now.

Copy link
Member Author

Choose a reason for hiding this comment

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

Relative URL is joined to original two lines above.
r_url is absolute at this line.

Copy link
Member

Choose a reason for hiding this comment

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

I'm interpreted it as schemaless url rather then relative one. Fine then.

Copy link
Member

@kxepal kxepal left a comment

Choose a reason for hiding this comment

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

LGFM. These are minor bits, but they can be done in separate work. Support relative redirects would be a new feature in anyway.

@asvetlov
Copy link
Member Author

@kxepal thank you for careful review.
Relative urls was processed by aiohttp as I've commented.

@asvetlov asvetlov merged commit feb4908 into master Oct 16, 2017
@asvetlov asvetlov deleted the auth-on-redirect branch October 16, 2017 17:10
@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.

4 participants