-
-
Notifications
You must be signed in to change notification settings - Fork 194
box.open open "/" return dir #173
Comments
Hot fix from above helps with opening
Wether you build with
And
Is there any hot fix for this? |
I've found a solution. This line of code should be replaced with
and this line should be replaced with
It worked for me, but I'm not sure is it a complete solution. |
I've also seen Also, I suspect this might tie in with #192, which points out some other places where the responsibilities are (AFAICS) not very well defined and divided between box, resolvers and others. |
Hello, this looks like a severe issue. From my understanding, the README example (https://github.com/gobuffalo/packr#usage-with-http) does not work anymore for Is there any elegant way to tackle that in the current version? Thanks! 👍 |
It supports it. |
Sorry, but no, it's not; or I'm not understanding something here 😞 $ tree .
.
├── main.go
└── templates
├── index.html
└── test.html I cannot access index.html, but test.html works fine. $ go version
go version go1.12.4 linux/amd64
$ cd $GOPATH/src/github.com/gobuffalo/packr/v2 && git describe --tags
v2.1.0 |
… -----------
Mark Bates
On Apr 14, 2019, 4:26 PM -0400, Loïck Bonniot ***@***.***>, wrote:
> It supports it.
Sorry, but no, it's not; or I'm not understanding something here 😞
I just created a file in my GOPATH, copied the main.go file from the README, and added a templates directory:
$ tree .
.
├── main.go
└── templates
├── index.html
└── test.html
I cannot access index.html, but test.html works fine.
$ go version
go version go1.12.4 linux/amd64
$ cd $GOPATH/src/github.com/gobuffalo/packr/v2 && git describe --tags
v2.1.0
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@markbates I've run the tests, they pass. Then exchanged the resolver with a disk resolver. Tests fail. I'm trying to figure out what's going on. |
As far as I can tell the difference is the Here is the relevant code: Lines 146 to 153 in e0e2368
So I think this is a valid issue after all. |
Pushed an experimental fix |
This seems to be a workaround:
|
now box.Open("/") is return a file (isDir is false) and err is nil
on
http.serveFile
the code innet/http/fs.go
code is redirect to "/" not “/index.html"
i fix the code in
func (b *Box) Open(name string) (http.File, error)
isThe text was updated successfully, but these errors were encountered: