summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2019-06-10 07:31:49 +0000
committerPhil Hughes <me@iamphill.com>2019-06-10 07:31:49 +0000
commite3072811475dcd563911a78fce85263b693d3fd6 (patch)
treeb174b929b0ebbc69c837e0b60392245d74334f1d /app
parent3017d2a52a3da5dc8e701f442b6d7c65c19cc054 (diff)
parent908829089c2f739af47e58bac11c51bd423bb2d1 (diff)
downloadgitlab-ce-e3072811475dcd563911a78fce85263b693d3fd6.tar.gz
Merge branch 'ce-5276-3-update-ide-diff-and-mirror-modules' into 'master'
[CE for Part 3] Update IDE file mirror service (ce utils) See merge request gitlab-org/gitlab-ce!29360
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/lib/utils/url_utility.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/app/assets/javascripts/lib/utils/url_utility.js b/app/assets/javascripts/lib/utils/url_utility.js
index b5474fc5c71..32fd0990374 100644
--- a/app/assets/javascripts/lib/utils/url_utility.js
+++ b/app/assets/javascripts/lib/utils/url_utility.js
@@ -1,3 +1,5 @@
+import { join as joinPaths } from 'path';
+
// Returns an array containing the value(s) of the
// of the key passed as an argument
export function getParameterValues(sParam) {
@@ -157,4 +159,12 @@ export function isSafeURL(url) {
}
}
-export { join as joinPaths } from 'path';
+export function getWebSocketProtocol() {
+ return window.location.protocol.replace('http', 'ws');
+}
+
+export function getWebSocketUrl(path) {
+ return `${getWebSocketProtocol()}//${joinPaths(window.location.host, path)}`;
+}
+
+export { joinPaths };