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
parent
f322f3c3d0
commit
81836ffbc6
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue