box.Open: Do not call file.NewFileR when IsDir true, fix #198#201
box.Open: Do not call file.NewFileR when IsDir true, fix #198#201markbates merged 5 commits intogobuffalo:masterfrom nlepage:fix/198-redirect-loop
Conversation
markbates
left a comment
There was a problem hiding this comment.
Would you mind adding a test to make sure this won’t regress? Thanks.
Yep no problem. |
|
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=trueis lost before returning tohttp.serveFile...Not sure this is the right fix, but it worked for me.
Thx in advance for your review.