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

prevent "308 PERMANENT REDIRECT" via client change #1320

Closed
melange396 opened this issue Oct 23, 2023 · 0 comments · Fixed by #1330
Closed

prevent "308 PERMANENT REDIRECT" via client change #1320

melange396 opened this issue Oct 23, 2023 · 0 comments · Fixed by #1330
Assignees
Labels
bug python client changes the Python client

Comments

@melange396
Copy link
Collaborator

melange396 commented Oct 23, 2023

Recent changes to the python client in #1288 make it so requests are made to endpoints directly, instead of using the api.php alias to do the proper routing. However, the client is not currently appending a trailing slash to these URLs, which prompts a "308 PERMANENT REDIRECT" response from the server.

The client "correctly" follows this up by re-requesting with the trailing slash present, but this wastes time on the client side by doubling the number of requests made, and wastes cycles on the server side.

compare for yourself the difference in the results from the two commands:
curl -vvvv https://api.delphi.cmu.edu/epidata/covidcast
and
curl -vvvv https://api.delphi.cmu.edu/epidata/covidcast/

Once this fix is complete, it should also automatically get applied to the covidcast client as well, as soon as users of that package update their dependencies to include the appropriate delphi-epidata release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug python client changes the Python client
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants