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

Default engine producing two log lines with StaticFS for 404 #1804

Closed
MusicAdam opened this issue Mar 9, 2019 · 2 comments
Closed

Default engine producing two log lines with StaticFS for 404 #1804

MusicAdam opened this issue Mar 9, 2019 · 2 comments
Labels
Milestone

Comments

@MusicAdam
Copy link
Contributor

MusicAdam commented Mar 9, 2019

  • go version: 1.11.4
  • gin version (or commit ref): master
  • operating system: OSX, 10.13.6

Description

I am receiving two log lines from a 404, even when using the default engine.

If I remove the router.StaticFS I no longer see the issue.

Code example:

func main() {
	router := gin.Default()
	router.StaticFS("/", http.Dir("/public"))
	router.Run(":1756")
}

Screenshots

Screen Shot 2019-03-09 at 12 07 48 PM

@sairoutine
Copy link
Contributor

This seems to be caused by PR #1663

sairoutine added a commit to sairoutine/gin that referenced this issue Mar 10, 2019
@thinkerou thinkerou added this to the 1.4 milestone Mar 11, 2019
@thinkerou thinkerou added the bug label Mar 11, 2019
appleboy pushed a commit that referenced this issue Mar 11, 2019
Fix: #1804

`allNoRoute` contains middlewares such as `gin.Logger`, `gin.Recovery`, so on.  The correct code is to use `noRoute`.

cc: @MetalBreaker
@sairoutine
Copy link
Contributor

@MusicAdam
Thank you for your report!

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

No branches or pull requests

3 participants