-
-
Notifications
You must be signed in to change notification settings - Fork 194
box.Open: Do not call file.NewFileR when IsDir true, fix #198 #201
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind adding a test to make sure this won’t regress? Thanks.
Yep no problem. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I reused The test is failing on the path It appears that the test doesn't cover the new condition I added in Both paths I'm going to dig a little further on this... BTW the CI reports a success although the test is failing ! |
I've been looking into First thing I noticed is that unlike And secondly, I'm surprised So I looked into I also tested the behavior of So I think the behavior of |
Sorry for the spam 🙂 I've been looking at the different resolvers in
In 3 cases the behavior is rather different, and this makes the tests written for @markbates don't you think a more consistent behavior would be better ? |
Absolutely! |
OK, I'm not sure where to go from here... @markbates could you give me some pointers ? In your opinion is it the responsibility of the |
put it all in This is a notoriously tricky part of Packr, even going back to v1. It's a bit of a whack-a-mole issue, as you're finding out. :) I appreciate you trying to fix this. |
No problem, I'll try something. |
If anyone wants to depend on this PR before it is merged (using go modules), add the following directive to the bottom of your go.mod file (keeping the normal packr dependency in your
|
Hi 👋
This is an attempt to fix issue #198
The redirect loop seems to happen because
isDir=true
is lost before returning tohttp.serveFile
...Not sure this is the right fix, but it worked for me.
Thx in advance for your review.