-
Notifications
You must be signed in to change notification settings - Fork 73
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: Allow to get files from git repository if file name starts with dot #351
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.
This needs to be backported to 7.52.x branch for DS 3.2. |
// since files retrieved via REST, we cannot use path symbols like . ./ so cut them off | ||
requestURL = remoteFactoryUrl.rawFileLocation(fileURL.replaceAll("^[/.]+", "")); | ||
// since files retrieved via REST, we cannot use path like '.' or one that starts with './' | ||
// or '../', so cut them off |
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.
If we cut ../
of then we will have a wrong location, right?
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.
We addressing the resource, beginning from the repository root, and this cutting does not change anything.
But yes, it looks a bit confusing, just take a look at the test https://github.com/eclipse-che/che-server/blob/main/wsmaster/che-core-api-factory-bitbucket-server/src/test/java/org/eclipse/che/api/factory/server/bitbucket/BitbucketServerAuthorizingFileContentProviderTest.java#L115
Let me try to remove cutting of ../
, update the PR and republish che-server
image, that is used to test.
Signed-off-by: Vitaliy Gulyy <[email protected]>
723d332
to
feb6310
Compare
Signed-off-by: Vitaliy Gulyy [email protected]
What does this PR do?
Fixes retrieving files from git repository when filename or directory name starts with dots.
Screenshot/screencast of this PR
What issues does this PR fix or reference?
Fixes eclipse-che/che#21635, and potentially eclipse-che/che#21639
How to test this PR?
Create a workspace with a factory
https://github.com/che-samples/java-spring-petclinic/tree/devfilev2?che-editor=eclipse/che-theia/next
Open Plugins view, check for installed plugins. Open terminal in editor container, check for
.vsix
files existence in/plugins/sidecars/tools
directory.PR Checklist
As the author of this Pull Request I made sure that:
What issues does this PR fix or reference
andHow to test this PR
completedReviewers
Reviewers, please comment how you tested the PR when approving it.