From dde3659b7e0254dc3be5eadf528657c09a597c0b Mon Sep 17 00:00:00 2001 From: Volodymyr Khrestin Date: Wed, 27 Nov 2019 17:35:53 +0200 Subject: [PATCH] Changed ReplaceAll to Replace --- swagger.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swagger.go b/swagger.go index 4039029..988b1d7 100644 --- a/swagger.go +++ b/swagger.go @@ -59,7 +59,7 @@ func CustomWrapHandler(config *Config, h *webdav.Handler) gin.HandlerFunc { specFileName = "doc.json" } - specRegexStr := strings.ReplaceAll(specFileName, ".", "\\.") + specRegexStr := strings.Replace(specFileName, ".", "\\.", -1) var rexp = regexp.MustCompile(`(.*)(index\.html|` + specRegexStr + `|favicon-16x16\.png|favicon-32x32\.png|/oauth2-redirect\.html|swagger-ui\.css|swagger-ui\.css\.map|swagger-ui\.js|swagger-ui\.js\.map|swagger-ui-bundle\.js|swagger-ui-bundle\.js\.map|swagger-ui-standalone-preset\.js|swagger-ui-standalone-preset\.js\.map)[\?|.]*`) return func(c *gin.Context) {