fix: Fix che-editor.yaml recognition (#334)

Pass the file path through the rawFileLocation function to avoid dot cut
Encode the .che/che-editor subpath to meet the Gitlab raw file request requirements.
pull/329/head
Igor Vinokur 2022-07-25 16:46:34 +03:00 committed by GitHub
parent f322f3c3d0
commit 81836ffbc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2021 Red Hat, Inc.
* Copyright (c) 2012-2022 Red Hat, Inc.
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
@ -55,7 +55,7 @@ public class GitlabScmFileResolver implements ScmFileResolver {
try {
return new GitlabAuthorizingFileContentProvider(
gitlabUrl, urlFetcher, gitCredentialManager, personalAccessTokenManager)
.fetchContent(filePath);
.fetchContent(gitlabUrl.rawFileLocation(filePath));
} catch (IOException e) {
throw new NotFoundException(e.getMessage());
} catch (DevfileException devfileException) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2021 Red Hat, Inc.
* Copyright (c) 2012-2022 Red Hat, Inc.
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
@ -207,7 +207,7 @@ public class GitlabUrl implements RemoteFactoryUrl {
.add(geProjectIdentifier())
.add("repository")
.add("files")
.add(fileName)
.add(encode(fileName, Charsets.UTF_8))
.add("raw")
.toString();
if (branch != null) {