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

unable to disable stripping trailing slash in url #482

Closed
vtolstov opened this issue Nov 11, 2015 · 1 comment
Closed

unable to disable stripping trailing slash in url #482

vtolstov opened this issue Nov 11, 2015 · 1 comment

Comments

@vtolstov
Copy link

I cant disable RedirectTrailingSlash

gin.SetMode(gin.ReleaseMode)
r := gin.Default()
r.RedirectTrailingSlash = false
r.RedirectFixedPath = true
r.StaticFS("/", http.FileSystem(root))
r.Run(":8080")
curl -v http://localhost:8080/metadata/
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /metadata/ HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.44.0
> Accept: */*
> 
< HTTP/1.1 301 Moved Permanently
< Location: ../metadata
< Date: Wed, 11 Nov 2015 10:07:33 GMT
< Content-Length: 0
< Content-Type: text/plain; charset=utf-8
< 
* Connection #0 to host localhost left intact
@thinkerou
Copy link
Member

@vtolstov 301 or 307 is the expect result when RedirectTrailingSlash = true or 404. Now the issue fixed.

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

No branches or pull requests

2 participants