Skip to content

Commit

Permalink
fix: trim error
Browse files Browse the repository at this point in the history
  • Loading branch information
hononet639 committed Nov 18, 2022
1 parent 41cf2ce commit 7b1dac8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions knife4g.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,14 @@ func Handler(config Config) gin.HandlerFunc {
if err != nil {
log.Println(err)
}
_ = tp.Execute(ctx.Writer, config)
err = tp.Execute(ctx.Writer, config)
if err != nil {
log.Println(err)
}
case docJsonPath:
ctx.Data(http.StatusOK, "application/json; charset=utf-8", docJson)
default:
ctx.FileFromFS(strings.TrimLeft(ctx.Request.RequestURI, config.RelativePath), http.FS(Front))
ctx.FileFromFS(strings.TrimPrefix(ctx.Request.RequestURI, config.RelativePath), http.FS(Front))
}

}
Expand Down

0 comments on commit 7b1dac8

Please sign in to comment.