Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add missing query string to the URI trailing slash redirect #523

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
Feb 3, 2025

Conversation

joseluisq
Copy link
Collaborator

@joseluisq joseluisq commented Feb 3, 2025

Description

This PR adds the missing query string to the URI when performing a trailing slash redirect only if the feature is enabled.

See feature: https://static-web-server.net/features/trailing-slash-redirect/.

Related Issue

Motivation and Context

How Has This Been Tested?

Before

$ curl -i "http://localhost:8787/assets?param=123"
# HTTP/1.1 308 Permanent Redirect
# location: /assets/
# vary: accept-encoding
# cache-control: public, max-age=86400
# content-length: 0
# date: Mon, 03 Feb 2025 21:19:19 GMT

After

$ curl -i "http://localhost:8787/assets?param=123"
# HTTP/1.1 308 Permanent Redirect
# location: /assets/?param=123
# vary: accept-encoding
# cache-control: public, max-age=86400
# content-length: 0
# date: Mon, 03 Feb 2025 21:19:29 GMT

Screenshots (if appropriate):

@joseluisq joseluisq added bug Something isn't working v2 v2 release labels Feb 3, 2025
Copy link

semanticdiff-com bot commented Feb 3, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  src/static_files.rs  58% smaller

@joseluisq joseluisq force-pushed the add-uri-query-trailing-slash-redirect branch from c672f71 to 1264fc2 Compare February 3, 2025 21:33
@joseluisq joseluisq marked this pull request as ready for review February 3, 2025 21:34
@joseluisq joseluisq merged commit a639039 into master Feb 3, 2025
27 of 36 checks passed
@joseluisq joseluisq deleted the add-uri-query-trailing-slash-redirect branch February 3, 2025 21:41
@joseluisq joseluisq added this to the v2.36.0 milestone Feb 6, 2025
@joseluisq joseluisq added bugfix This is PR fixes a bug and removed bug Something isn't working labels Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This is PR fixes a bug v2 v2 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant