Skip to content

Conversation

@Mooninaut
Copy link
Contributor

@Mooninaut Mooninaut commented May 25, 2022

Escape . to prevent removing the trailing character from a simple directory name with no leading / or ./

Anchor the regex to prevent stripping a trailing literal . from a directory name, which is unlikely but possible

Add tests for simple resource directory and resource directory with trailing .

Examples of bug:
.directory("envdir") would try to load resources/envdi/.env and fail
.directory("/trailingdot./envdir") would try to load resources/trailingdot/envdir/.env and fail

Workaround: Always prefix classpath-relative directories with ./

Clement Cherlin added 2 commits May 25, 2022 09:54
Escape "." to prevent removing the trailing character from a simple directory name with no leading "/" or "./"

Anchor the regex to prevents stripping a trailing literal "." from a directory name, which is unlikely but possible

Add tests for simple resource directory and resource directory with trailing "."

Examples of bug:
.directory("envdir") would try to load "resources/envdi/.env" and fail.
.directory("/trailingdot./envdir") would try to load "resources/trailingdot/envdir/.env") and fail.
@cdimascio cdimascio merged commit 6dc4c52 into cdimascio:master May 29, 2022
@cdimascio
Copy link
Owner

@all-contributors add @Mooninaut for code and test

@allcontributors
Copy link
Contributor

@cdimascio

I've put up a pull request to add @Mooninaut! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants