-
Notifications
You must be signed in to change notification settings - Fork 8k
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
fix bug #1682
fix bug #1682
Conversation
@MetalBreaker please review the pull request, thanks! |
Codecov Report
@@ Coverage Diff @@
## master #1682 +/- ##
==========================================
+ Coverage 99.39% 99.39% +<.01%
==========================================
Files 41 41
Lines 1993 1995 +2
==========================================
+ Hits 1981 1983 +2
Misses 9 9
Partials 3 3
Continue to review full report at Codecov.
|
@@ -187,8 +187,11 @@ func (group *RouterGroup) createStaticHandler(relativePath string, fs http.FileS | |||
fileServer := http.StripPrefix(absolutePath, http.FileServer(fs)) | |||
|
|||
return func(c *Context) { | |||
file := c.Param("filepath") | |||
if _, nolisting := fs.(*onlyfilesFS); nolisting { | |||
c.Writer.WriteHeader(http.StatusNotFound) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no return?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, if there have return it lead to TestRouterMiddlewareAndStatic
error. because need to run fileServer.ServeHTTP
.
👍 |
fix: