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 path normalization service with tower-http #11

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

ezrasingh
Copy link
Owner

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

The PR updates the path normalization to allow for either a trailing slash or no trailing slash in client requests. This ensures consistent URL handling regardless of the presence of a trailing slash.

Key Changes

  • Added support for path normalization using towerhttp.
  • Implemented a middleware for normalizing paths to ensure consistent URL handling.

Related Tickets & Documents

QA Instructions, Screenshots, Recordings

  • To test the changes, run the server and make requests to the endpoints GET /api/v1/geohash/xn6mfn and GET /api/v1/geohash/xn6mfn/. Both should return the expected results, regardless of the trailing slash.

Added/updated tests?

  • Yes
  • No, and this is why: I believe this change is better suited for end-to-end testing rather than unit tests.
  • I need help with writing tests

@ezrasingh ezrasingh added the enhancement New feature or request label Aug 12, 2024
@ezrasingh ezrasingh added this to the v1.0.0 milestone Aug 12, 2024
@ezrasingh ezrasingh self-assigned this Aug 12, 2024
@ezrasingh ezrasingh linked an issue Aug 12, 2024 that may be closed by this pull request
@ezrasingh ezrasingh merged commit e72b068 into main Aug 12, 2024
6 checks passed
@ezrasingh ezrasingh deleted the 4-add-path-normalization-for-api-endpoints branch August 12, 2024 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add Path Normalization For API Endpoints
1 participant