소스 검색

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.
error10 10 년 전
부모
커밋
2b8ed80da0
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      gin.go

+ 1 - 1
gin.go

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