-
Notifications
You must be signed in to change notification settings - Fork 25
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
fix(*): patch expanduser to be more friendly to OpenResty environment #111
Conversation
Luacheck Report76 tests 0 ✅ 0s ⏱️ For more details on these failures, see this check. Results for commit d0f91c0. ♻️ This comment has been updated with latest results. |
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.
Then userfriendly way to resolve this is to read the env vars in the config
module along with the others (the AWS specific ones).
Probably best to copy the Penlight code here, and modify it to fall back to the cached variables.
Just ensure we also cater for Windows (despite we're not using it)
A bug has also been detected that expanded file path is not being used to read content, see: lua-resty-aws/src/resty/aws/config.lua Line 185 in 1f3b8bb
I fixed it in the latest commit |
@Tieske Yes, I intended to not handle the error returned by these three functions as the In the last commit, I added some debug logs to these three functions in case we encounter error and have problem debugging them. Please review again! Thanks |
BTW; does need a changelog entry! |
Summary
pl.path.expanduser
may return withnil, err
when received a path argument starting with~
but$HOME
(or other home path related) environment variable is not present. This PR adds proper error handling code when callingexpanduser
.