Skip to content

implement allow_redirects argument #132

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

Merged
merged 1 commit into from
May 30, 2023
Merged

Conversation

FoamyGuy
Copy link
Contributor

@FoamyGuy FoamyGuy commented May 19, 2023

this change adds the allow_redirects argument to the request methods. It defaults to True so that current behavior stays the same for anyone who doesn't explicitly change the argument to False.

If it's False it will return the redirect response (300 level status code) to the caller that initiated the request instead of automatically following the redirect and returning the final response to the caller.

This matches the functionality in the CPython requests library API

@FoamyGuy FoamyGuy requested a review from a team May 19, 2023 17:34
Copy link
Member

@tekktrik tekktrik left a comment

Choose a reason for hiding this comment

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

I didn't test but this looks sensible and correct to me, thanks for the addition!

@tekktrik tekktrik merged commit c40cb25 into adafruit:main May 30, 2023
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request May 31, 2023
Updating https://github.com/adafruit/Adafruit_CircuitPython_BMP280 to 3.3.0 from 3.2.20:
  > Merge pull request adafruit/Adafruit_CircuitPython_BMP280#39 from somenice/main

Updating https://github.com/adafruit/Adafruit_CircuitPython_BNO08X to 1.2.3 from 1.2.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_BNO08x#42 from rrahkola/dev/add_type_attributes

Updating https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k to 2.5.3 from 2.5.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_Wiznet5k#117 from tekktrik/dev/fix-packaging

Updating https://github.com/adafruit/Adafruit_CircuitPython_Dash_Dis to 1.1.16 from 1.1.15:
  > Merge pull request adafruit/Adafruit_CircuitPython_Dash_Dis#9 from julianaklulo/main

Updating https://github.com/adafruit/Adafruit_CircuitPython_Requests to 1.14.0 from 1.13.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_Requests#132 from FoamyGuy/allow_redirects

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Updated download stats for the libraries
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.

2 participants