From a09aa7f84e9e0015888ae7d13fe930b6ce095c55 Mon Sep 17 00:00:00 2001 From: Rinjae Date: Mon, 5 Jan 2026 15:56:37 +0900 Subject: [PATCH] =?UTF-8?q?https=20=EB=8F=84=EB=A9=94=EC=9D=B8=20=EC=A0=91?= =?UTF-8?q?=EC=86=8D=EC=8B=9C=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EC=9D=B4=EB=8F=99=20=EC=98=A4=EB=8F=99?= =?UTF-8?q?=EC=9E=91=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebContent/js/common-en.js | 16 +++++++--------- WebContent/js/common-ko.js | 11 +++++------ WebContent/js/custom.js | 2 +- WebContent/jsp/js/common-en.js | 16 +++++++--------- WebContent/jsp/js/common-ko.js | 14 ++++++-------- 5 files changed, 26 insertions(+), 33 deletions(-) diff --git a/WebContent/js/common-en.js b/WebContent/js/common-en.js index 0487b36..6a983ab 100644 --- a/WebContent/js/common-en.js +++ b/WebContent/js/common-en.js @@ -37,16 +37,14 @@ function isChromeBrowse() { } // find Context -function getContextName() -{ - // get context - var loc = location.href; - var sPos = loc.indexOf("/", 7) - var ePos = loc.indexOf("/", sPos+1) +function getContextName() { + // get context path from pathname (works with both http and https) + var pathname = location.pathname; + var pos = pathname.indexOf("/", 1); - if (ePos == -1) return "/"; - else return loc.substr(sPos, ePos-sPos + 1); -} + if (pos == -1) return pathname.endsWith("/") ? pathname : pathname + "/"; + else return pathname.substring(0, pos + 1); +} // return today : 20081231 function getToday() { diff --git a/WebContent/js/common-ko.js b/WebContent/js/common-ko.js index 8474645..59f170d 100644 --- a/WebContent/js/common-ko.js +++ b/WebContent/js/common-ko.js @@ -37,13 +37,12 @@ function isChromeBrowse() { // find Context function getContextName() { - // get context - var loc = location.href; - var sPos = loc.indexOf("/", 7) - var ePos = loc.indexOf("/", sPos + 1) + // get context path from pathname (works with both http and https) + var pathname = location.pathname; + var pos = pathname.indexOf("/", 1); - if (ePos == -1) return "/"; - else return loc.substr(sPos, ePos - sPos + 1); + if (pos == -1) return pathname.endsWith("/") ? pathname : pathname + "/"; + else return pathname.substring(0, pos + 1); } // return today : 20081231 diff --git a/WebContent/js/custom.js b/WebContent/js/custom.js index c71c8b0..e6bb511 100644 --- a/WebContent/js/custom.js +++ b/WebContent/js/custom.js @@ -149,7 +149,7 @@ jQuery.showModalDialog = function(options) { $().showModalDialog(options); }; var originalError = options.error; options.error = function(xhr, status, error) { if(xhr.status === 401) { - var location = getContextName() + '/'; + var location = getContextName(); comloadError(xhr, status, error, location); return; } diff --git a/WebContent/jsp/js/common-en.js b/WebContent/jsp/js/common-en.js index d5c846f..11a67eb 100644 --- a/WebContent/jsp/js/common-en.js +++ b/WebContent/jsp/js/common-en.js @@ -37,16 +37,14 @@ function isChromeBrowse() { } // find Context -function getContextName() -{ - // get context - var loc = location.href; - var sPos = loc.indexOf("/", 7) - var ePos = loc.indexOf("/", sPos+1) +function getContextName() { + // get context path from pathname (works with both http and https) + var pathname = location.pathname; + var pos = pathname.indexOf("/", 1); - if (ePos == -1) return "/"; - else return loc.substr(sPos, ePos-sPos + 1); -} + if (pos == -1) return pathname.endsWith("/") ? pathname : pathname + "/"; + else return pathname.substring(0, pos + 1); +} // return today : 20081231 function getToday() { diff --git a/WebContent/jsp/js/common-ko.js b/WebContent/jsp/js/common-ko.js index 1a2af10..ffdff43 100644 --- a/WebContent/jsp/js/common-ko.js +++ b/WebContent/jsp/js/common-ko.js @@ -37,15 +37,13 @@ function isChromeBrowse() { } // find Context -function getContextName() -{ - // get context - var loc = location.href; - var sPos = loc.indexOf("/", 7) - var ePos = loc.indexOf("/", sPos+1) +function getContextName() { + // get context path from pathname (works with both http and https) + var pathname = location.pathname; + var pos = pathname.indexOf("/", 1); - if (ePos == -1) return "/"; - else return loc.substr(sPos, ePos-sPos + 1); + if (pos == -1) return pathname.endsWith("/") ? pathname : pathname + "/"; + else return pathname.substring(0, pos + 1); } // return today : 20081231 function getToday()