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

Static middleware changed behaviour? #1400

Closed
3 tasks done
ghost opened this issue Sep 18, 2019 · 6 comments
Closed
3 tasks done

Static middleware changed behaviour? #1400

ghost opened this issue Sep 18, 2019 · 6 comments
Labels
stale Marked as stale for auto-closing unconfirmed Possible bug, but needs to be reproduced first.

Comments

@ghost
Copy link

ghost commented Sep 18, 2019

Issue Description

I updated echo in one of my projects. After that my static configuration didn't work without changes. Before it automatically resolved to an existing index.html. After that I had to point to that file.

My code was something like that:

docsGroup := e.Group("")
docsGroup.Static("/", "docs")

In docs is an index.html which was delivered when no path was given.

Now I need to use docsGroup.File("/", "docs/index.html") to make it work again.

The change was somewhere between 4.1.3 and 4.1.5.

Checklist

  • Dependencies installed
  • No typos
  • Searched existing issues and docs
@pablote
Copy link

pablote commented Oct 27, 2019

I'm running into a similar issue, might be related, started happening after I moved to v4 from v3.

This routes used to work:

e.Static("/", "web/public")
e.Static("/dashboard", "web/public")
e.Static("/sessionexpired", "web/public")

Now only the first route works, the other ones do not. They do work however if I add a trailing slash on the browser.

@lammel
Copy link
Contributor

lammel commented Sep 2, 2020

This should have been fixed with #1563.

@pablote Can you confirm this is fixed for you?

@lammel lammel added the unconfirmed Possible bug, but needs to be reproduced first. label Sep 2, 2020
@lammel
Copy link
Contributor

lammel commented Sep 2, 2020

This sounds like a duplicate of #1533

@lammel
Copy link
Contributor

lammel commented Sep 2, 2020

#1568 is also somewhat related which has a similar issue with groups.

@pablote
Copy link

pablote commented Sep 2, 2020

I’m not using Echo#Static anymore, I’ve since moved to using the Static middleware, which has the html5 routing functionality that I needed:

e.Use(middleware.StaticWithConfig(middleware.StaticConfig{
		Root:   "web/build",
		HTML5:  true,
		Browse: false,
	}))```

@lammel lammel added the stale Marked as stale for auto-closing label Mar 9, 2021
@lammel
Copy link
Contributor

lammel commented Mar 9, 2021

Closing due to original reporting being a ghost now.

@lammel lammel closed this as completed Mar 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Marked as stale for auto-closing unconfirmed Possible bug, but needs to be reproduced first.
Projects
None yet
Development

No branches or pull requests

2 participants