We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Enabling RedirectFixedPath sometimes leads to infinite redirects
RedirectFixedPath
package main import ( "github.com/gin-gonic/gin" ) func main() { r := gin.Default() r.GET("/あ", func(c *gin.Context) { c.JSON(200, gin.H{}) }) r.UnescapePathValues = false r.UseRawPath = true r.RedirectFixedPath = true r.Run(":8181") }
$ curl 'localhost:8181/%E3%81%82' -L {} $ curl 'localhost:8181/%e3%81%82' -L {} $ curl 'localhost:8181/あ' -L {}
$ curl 'localhost:8181/%E3%81%82' -L {} $ curl 'localhost:8181/%e3%81%82' -L curl: (47) Maximum (50) redirects followed $ curl 'localhost:8181/あ' -L curl: (47) Maximum (50) redirects followed
go version: 1.23.0 gin version (or commit ref): v1.10.0 operating system: macOS Sequoia
The text was updated successfully, but these errors were encountered:
Using /あ for comparison, but using /%e3%81%82 when redirecting, so it causes an infinite loop.
/あ
/%e3%81%82
If using EscapedPath for comparison, responsing 404 not found
EscapedPath
maybe we use req.URL.Path for redirecting, not useing req.URL.String().
req.URL.Path
req.URL.String()
Sorry, something went wrong.
Using /あ for comparison, but using /%e3%81%82 when redirecting, so it causes an infinite loop. If using EscapedPath for comparison, responsing 404 not found maybe we use req.URL.Path for redirecting, not useing req.URL.String().
ohhh... when it set Location header, it will escape url.
Location
No branches or pull requests
Description
Enabling
RedirectFixedPath
sometimes leads to infinite redirectsHow to reproduce
Expectations
Actual result
Environment
go version: 1.23.0
gin version (or commit ref): v1.10.0
operating system: macOS Sequoia
The text was updated successfully, but these errors were encountered: