RedirectTrailingSlash has no effect unless RedirectFixedPath is set

Which is not likely the desired behavior.

RedirectTrailingSlash setting is meant to cause a redirect, but the code is never called because the setting wasn't being checked. Instead RedirectFixedPath was being checked.
This commit is contained in:
error10 2015-07-04 00:05:53 -04:00
parent 0316b735c4
commit 2b8ed80da0
1 changed files with 1 additions and 1 deletions

2
gin.go
View File

@ -294,7 +294,7 @@ func (engine *Engine) handleHTTPRequest(context *Context) {
return return
} else if httpMethod != "CONNECT" && path != "/" { } else if httpMethod != "CONNECT" && path != "/" {
if tsr && engine.RedirectFixedPath { if tsr && engine.RedirectTrailingSlash {
redirectTrailingSlash(context) redirectTrailingSlash(context)
return return
} }