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: trailing slash conflict for api endpoints #616

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

justEhmadSaeed
Copy link
Contributor

Description

Because Django adds a trailing slash at the end of the URL by default, adding a trailing slash to the endpoint makes it throw a 301 error. This PR makes it allow a trailing slash.

Link to the associated ticket: https://2u-internal.atlassian.net/browse/ENT-8526

Testing considerations

  • Include instructions for any required manual tests, and any manual testing that has
    already been performed.
  • Include unit and a11y tests as appropriate
  • Consider performance issues.
  • Check that Database migrations are backwards-compatible

Post-review

Squash commits into discrete sets of changes

@pwnage101
Copy link
Contributor

Is the purpose of adding this complexity to improve performance? Are there frontends or other callers which frequently do not pass a trailing slash?

@justEhmadSaeed
Copy link
Contributor Author

Is the purpose of adding this complexity to improve performance? Are there frontends or other callers which frequently do not pass a trailing slash?

@pwnage101 while publishing subscriptions and other license endpoints on the AWS gateway, we faced the issue of inconsistent trailing slash for endpoints where some endpoints require a trailing slash while others don't. If the developers follow a consistent pattern, they face unexpected redirect errors that are hard to debug and recreate locally.

This PR makes it irrelevant whether you add trailing slash or not, it'll work and the publishing code can remain consistent with their practices.

@sameenfatima78 sameenfatima78 marked this pull request as ready for review March 13, 2024 10:20
@justEhmadSaeed justEhmadSaeed merged commit 664b16e into master Mar 13, 2024
7 checks passed
@justEhmadSaeed justEhmadSaeed deleted the asaeed/ENT-8526 branch March 13, 2024 12:58
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.

3 participants