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

Added the ability to retrieve url from BaseResponse #623

Closed
wants to merge 10 commits into from

Conversation

elmoiv
Copy link

@elmoiv elmoiv commented Sep 30, 2021

No description provided.

@google-cla
Copy link

google-cla bot commented Sep 30, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no label Sep 30, 2021
@elmoiv
Copy link
Author

elmoiv commented Sep 30, 2021

@googlebot I signed it!

@google-cla google-cla bot added cla: yes and removed cla: no labels Sep 30, 2021
@kevmoo
Copy link
Member

kevmoo commented Oct 1, 2021

Add some documentation to the parameter and the field?

Why are you adding this? How does it help you?

@elmoiv
Copy link
Author

elmoiv commented Oct 1, 2021

It comes in handy when working with redirected urls. Like if I want to get the final retrieved URL after all redirects are done.

This adds the ability to get that from a http.get instead of the current workaround of setting followRedirects to false in http.Request or trying to check if response headers has the final url or not.

This was inspired from Python requests library

@elmoiv
Copy link
Author

elmoiv commented Oct 1, 2021

It appears that Dart CI Chrome tests are broken.

natebosch added a commit that referenced this pull request May 25, 2022
Closes #321, closes #623, closes #692
Fixes #293

Add a Uri field to BaseResponse with the final, potentially redirected,
url for the content.

The field is nullable for backwards compatibility - TODO: consider if
this should be non-nullable from the start, or if it can be published
nullable first and become non-nullable (and the constructor arg
required) in the next breaking release.

This may break tests which use bocks but do not mock the field used to
read the URL.
@natebosch natebosch mentioned this pull request May 25, 2022
@natebosch
Copy link
Member

If we are able to roll out this feature I think we'll use a Uri field instead of String. I'll pick this up in #699

@natebosch natebosch closed this May 25, 2022
@brianquinlan brianquinlan mentioned this pull request Jan 9, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants