Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-04 03:09:37 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-04 03:09:37 +0300
commite3bdfa1a13d7e6c92716324c78b5b20c07eeb7c6 (patch)
treee8776263096b027d32d4be5118cccc87b00de2bc /app/assets/javascripts/lib/utils/url_utility.js
parentc1a50b8195f4e36fda9b233acbde57a449bcf6c3 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/lib/utils/url_utility.js')
-rw-r--r--app/assets/javascripts/lib/utils/url_utility.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/assets/javascripts/lib/utils/url_utility.js b/app/assets/javascripts/lib/utils/url_utility.js
index 1ff4f7bab97..a495d2040d3 100644
--- a/app/assets/javascripts/lib/utils/url_utility.js
+++ b/app/assets/javascripts/lib/utils/url_utility.js
@@ -318,3 +318,11 @@ export const setUrlParams = (params, url = window.location.href, clearParams = f
export function urlIsDifferent(url, compare = String(window.location)) {
return url !== compare;
}
+
+export function getHTTPProtocol(url) {
+ if (!url) {
+ return window.location.protocol.slice(0, -1);
+ }
+ const protocol = url.split(':');
+ return protocol.length > 1 ? protocol[0] : undefined;
+}