Skip to content
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

Merged
merged 1 commit into from
Dec 5, 2018
Merged

fix bug #1682

merged 1 commit into from
Dec 5, 2018

Conversation

thinkerou
Copy link
Member

fix:

=== RUN   TestRouteStaticNoListing
--- FAIL: TestRouteStaticNoListing (0.00s)
	assertions.go:256: 
			Error Trace:	routes_test.go:298
			Error:      	Not equal: 
			            	expected: 404
			            	actual  : 200
			Test:       	TestRouteStaticNoListing

@thinkerou thinkerou added this to the 1.4 milestone Dec 5, 2018
@thinkerou thinkerou added the bug label Dec 5, 2018
@thinkerou
Copy link
Member Author

@MetalBreaker please review the pull request, thanks!

@codecov
Copy link

codecov bot commented Dec 5, 2018

Codecov Report

Merging #1682 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
routergroup.go 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f463d84...75090f5. Read the comment docs.

@@ -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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no return?

Copy link
Member Author

@thinkerou thinkerou Dec 5, 2018

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.

@thinkerou thinkerou merged commit 98c7ac7 into gin-gonic:master Dec 5, 2018
@ilijaivanov
Copy link
Contributor

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants