Skip to content

Commit 5291702

Browse files
committed
test
1 parent 24f7dc1 commit 5291702

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

ui/src/app/getCookie.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ export const getCookie = (cookieName: string) => {
44
const ca = decodedCookie.split(";");
55
for (let i = 0; i < ca.length; i += 1) {
66
let c = ca[i];
7-
while (c.startsWith(" ")) {
7+
while (c.charAt(0) === " ") {
88
c = c.substring(1);
99
}
10-
if (c.startsWith(name)) {
10+
if (c.indexOf(name) === 0) {
1111
return c.substring(name.length, c.length);
1212
}
1313
}

ui/src/app/home.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ export class HomeComponent implements OnInit {
5050
}
5151

5252
private getCurrentHost() {
53-
const host = globalThis.location.host;
54-
const url = `${globalThis.location.protocol}//${host}`;
53+
const host = window.location.host;
54+
const url = `${window.location.protocol}//${host}`;
5555

5656
return url;
5757
}

ui/src/app/secure-api.interceptor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export function secureApiInterceptor(
77
) {
88
const secureRoutes = [getApiUrl()];
99

10-
if (!secureRoutes.some((x) => request.url.startsWith(x))) {
10+
if (!secureRoutes.find((x) => request.url.startsWith(x))) {
1111
return next(request);
1212
}
1313

@@ -28,7 +28,7 @@ function getApiUrl() {
2828
}
2929

3030
function getCurrentHost() {
31-
const host = globalThis.location.host;
32-
const url = `${globalThis.location.protocol}//${host}`;
31+
const host = window.location.host;
32+
const url = `${window.location.protocol}//${host}`;
3333
return url;
3434
}

0 commit comments

Comments
 (0)