diff options
author | Phil Hughes <me@iamphill.com> | 2019-05-02 16:45:45 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2019-05-02 16:45:45 +0300 |
commit | 888840b6a33d6f6d80b3753a5f3ed4a3a8280dac (patch) | |
tree | c67dabaf662fb01830e0e2f0248356ec97a07505 /app/assets/javascripts/ide | |
parent | f69092509caf5b18cfec4c6dc4209bab8fffbf25 (diff) | |
parent | ee32e06f1f117e748963a8badf6abfd5b57f339b (diff) |
Merge branch 'fix-ide-relative-url-bug' into 'master'
Fix IDE get file data with '/' as relative root
See merge request gitlab-org/gitlab-ce!27911
Diffstat (limited to 'app/assets/javascripts/ide')
-rw-r--r-- | app/assets/javascripts/ide/stores/actions/file.js | 7 |
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'])); |