From 2c89e169769ead722394a79ed67fcd08e96863dd Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 12 Feb 2020 15:09:37 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/assets/javascripts/lib/utils/url_utility.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/assets/javascripts/lib') diff --git a/app/assets/javascripts/lib/utils/url_utility.js b/app/assets/javascripts/lib/utils/url_utility.js index 267b49e9d98..1ff4f7bab97 100644 --- a/app/assets/javascripts/lib/utils/url_utility.js +++ b/app/assets/javascripts/lib/utils/url_utility.js @@ -194,12 +194,14 @@ export function redirectTo(url) { return window.location.assign(url); } +export const escapeFileUrl = fileUrl => encodeURIComponent(fileUrl).replace(/%2F/g, '/'); + export function webIDEUrl(route = undefined) { let returnUrl = `${gon.relative_url_root || ''}/-/ide/`; if (route) { returnUrl += `project${route.replace(new RegExp(`^${gon.relative_url_root || ''}`), '')}`; } - return returnUrl; + return escapeFileUrl(returnUrl); } /** @@ -313,8 +315,6 @@ export const setUrlParams = (params, url = window.location.href, clearParams = f return urlObj.toString(); }; -export const escapeFileUrl = fileUrl => encodeURIComponent(fileUrl).replace(/%2F/g, '/'); - export function urlIsDifferent(url, compare = String(window.location)) { return url !== compare; } -- cgit v1.2.3