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 : gin config RemoveExtraSlash do not work when use static … #2893

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mmtbak
Copy link

@mmtbak mmtbak commented Oct 6, 2021

when i config static path in my project

code:

	app = gin.Default()
	app.RemoveExtraSlash = true
	app.Static("/static", "my-static-path")

request

# curl 127.0.0.1/static/test.json
# test.json  

# curl 127.0.0.1///static/test.json
# 404 page not found

because handler createStaticHandler.func1 ignore rPath , so change request data then handler will process request in right way .

c.Request.URL.Path = rPath
  • With pull requests:
    • Open your pull request against master
    • Your pull request should have no more than two commits, if not you should squash them.
    • It should pass all tests in the available continuous integration systems such as GitHub Actions.
    • You should add/modify tests to cover your proposed code changes.
    • If your pull request contains a new feature, please document it on the README.

@thinkerou
Copy link
Member

please add some unit test, thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants