-
-
Notifications
You must be signed in to change notification settings - Fork 194
Packer v2 http.FileServer(box) failed to serve index.html with go v1.12.4 and packr Version 2.2.0? #198
Comments
Hello, same thing happened with me. go.12 I should note that my code was working fine with packr 1 |
Also observing this problem Windows 10 Was using statik and look forward to switching to this solution |
Hi @gpkfr @marcotuna @StevenWeathers I also ran into this issue, I tried to make a fix if you want to have a look : #201 |
yes, it seem to resolve this issue. Thanks for your time ;) |
I have the same issue, inside a Buffalo app. When I put my "index.html" file inside the "public" folder, I get redirected to an invalid location. At the same time, requesting other files (or skipping packr and loading from the filesystem directly) works. curl -v http://localhost:3001/
* Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 3001 (#0)
> GET / HTTP/1.1
> Host: localhost:3001
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Cache-Control: max-age=31536000
< Etag: 159eb8d6c587bfa0
< Location: ..//
< Vary: Origin
< Date: Wed, 15 May 2019 02:02:33 GMT
< Content-Length: 0
<
* Connection #0 to host localhost left intact |
See #173 |
@sagikazarmark I looked at the issue but not sure what to make out of that? |
As far as I can tell it's the same issue. I posted my findings and a possible workaround there, but it turned out later there is already a PR for the issue. |
Has there been any updates to this issue? I am also running into this same issue using Go v1.12.4 and Packr v2.3.2 and run into the same redirect loop with a URL like http://localhost:3000//. I am using the same script as is directed in the v2 package main
import (
"net/http"
"github.com/gobuffalo/packr/v2"
)
func main() {
box := packr.New("someBoxName", "./templates")
http.Handle("/", http.FileServer(box))
http.ListenAndServe(":3000", nil)
} I also noticed the PR from @nlepage above, I will test this to see if it fixes my issues - has there been any updates to its status? |
some kind of change was made and versions of creamy-videos built with newer versions of packr2 caused redirect loops on webroot. attempted fixing this using a couple methods but didn't have any luck. there was a fix added here but it was later (temporarily) reverted: gobuffalo/packr#198 gobuffalo/packr#217
Hello there, |
Yes. As I said the tests keep failing. Another PR needs to be opened to resolve the failing tests. |
I have this little workaround: https://gist.github.com/mhewedy/65895bced03e75167f2c78cc08994cb8 |
Hello,
index.html create a redirect loop then fail with url like "http://localhost:3000//"
(All other static file work as expected);
OS MacOs v10.14.4
Go version 1.12.4
Packr2 V2.2.0
test program :
The text was updated successfully, but these errors were encountered: