summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorPaul Slaughter <pslaughter@gitlab.com>2019-04-30 11:35:12 -0500
committerPaul Slaughter <pslaughter@gitlab.com>2019-04-30 13:09:40 -0500
commitee32e06f1f117e748963a8badf6abfd5b57f339b (patch)
treec4ed8ebc710127d6932cd9c7ad91fc92ec726e72 /app
parent2432a540cff461c5d9c0346dd4021229078d674d (diff)
downloadgitlab-ce-ee32e06f1f117e748963a8badf6abfd5b57f339b.tar.gz
Fix IDE get file data with '/' as relative rootfix-ide-relative-url-bug
https://gitlab.com/gitlab-org/gitlab-ce/issues/60932
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/ide/stores/actions/file.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/assets/javascripts/ide/stores/actions/file.js b/app/assets/javascripts/ide/stores/actions/file.js
index e74b880e02c..e7e8ac6d80b 100644
--- a/app/assets/javascripts/ide/stores/actions/file.js
+++ b/app/assets/javascripts/ide/stores/actions/file.js
@@ -1,5 +1,6 @@
-import { __ } from '../../../locale';
-import { normalizeHeaders } from '../../../lib/utils/common_utils';
+import { joinPaths } from '~/lib/utils/url_utility';
+import { normalizeHeaders } from '~/lib/utils/common_utils';
+import { __ } from '~/locale';
import eventHub from '../../eventhub';
import service from '../../services';
import * as types from '../mutation_types';
@@ -69,7 +70,7 @@ export const getFileData = (
const url = file.prevPath ? file.url.replace(file.path, file.prevPath) : file.url;
return service
- .getFileData(`${gon.relative_url_root ? gon.relative_url_root : ''}${url.replace('/-/', '/')}`)
+ .getFileData(joinPaths(gon.relative_url_root || '', url.replace('/-/', '/')))
.then(({ data, headers }) => {
const normalizedHeaders = normalizeHeaders(headers);
setPageTitle(decodeURI(normalizedHeaders['PAGE-TITLE']));