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

fix(client): ensure urls have trailing slashes #361

Merged
merged 5 commits into from
Jan 31, 2025
Merged

Conversation

mitchnielsen
Copy link
Contributor

Some API routes need to have a trailing slash on the end. If they don't,
you can see errors such as 404, 405, 307, etc.

Closes https://linear.app/prefect/issue/PLA-948/workspace-create-fails-with-404-when-endpoint-is-set

Closes #359

Some API routes need to have a trailing slash on the end. If they don't,
you can see errors such as 404, 405, 307, etc.

Closes https://linear.app/prefect/issue/PLA-948/workspace-create-fails-with-404-when-endpoint-is-set

Closes #359
Adds a script to help check which routes have trailing slashes.
@mitchnielsen mitchnielsen marked this pull request as ready for review January 31, 2025 00:05
@mitchnielsen mitchnielsen requested a review from a team as a code owner January 31, 2025 00:05
Comment on lines +32 to +36
curl -s https://api.prefect.cloud/api/openapi.json |
jq '.paths
| to_entries
| map({path: .key, method: (.value | to_entries[0].key), desc: (.value | to_entries[0].value.description)})
| map(select(.path | test("/$")))'
Copy link
Contributor

Choose a reason for hiding this comment

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

this is great! Is there anywhere in our development guides that we should add a note/reference to this to point community contributors to?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good idea, I'll add a note in the Contributing guide 👌

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done in 38edad2

Copy link
Contributor

@jamiezieziula jamiezieziula left a comment

Choose a reason for hiding this comment

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

This is awesome - bonus points for the script

@mitchnielsen mitchnielsen merged commit 532de87 into main Jan 31, 2025
7 checks passed
@mitchnielsen mitchnielsen deleted the trailing-slashes branch January 31, 2025 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Workspace Create fails with 404 when endpoint is set
2 participants