Skip to content
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

Improve error message in AbstractFileSource#assertFilePathIsUnderRoot() #2267

Merged

Conversation

oleg-nenashev
Copy link
Member

As reported on Slack, the current error message in the response is confusing and does not contain a reason when a non-absolute path is passed through API

<title>Error 500 com.github.tomakehurst.wiremock.security.NotAuthorisedException: Access to file
        ../resources/__files/get-users-200.json is not permitted</title>
getting this error when i am trying to connect to my json file.

Submitter checklist

  • The PR request is well described and justified, including the body and the references
  • The PR title represents the desired changelog entry
  • The repository's code style is followed (see the contributing guide)
  • Test coverage that demonstrates that the change works as expected => SingleRootFileSourceTest#writeThrowsExceptionWhenRootIsNotDir()
  • [ x For new features, there's necessary documentation in this pull request or in a subsequent PR to wiremock.org

@oleg-nenashev oleg-nenashev requested a review from a team as a code owner July 13, 2023 09:58
@oleg-nenashev
Copy link
Member Author

spotlessJavaCheck ...

@oleg-nenashev oleg-nenashev merged commit 36f808b into wiremock:master Jul 19, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants