Skip to content

Commit fe23751

Browse files
committed
white labels hotfix
1 parent a5c68b3 commit fe23751

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

server/getDynamicIndex.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,19 @@ export const getDynamicIndex = (baseprefix: string): string => {
77

88
// Generate favicon from SVG if provided
99
const generateFavicon = (): string => {
10-
if (!iconSvg) {
11-
return ''
12-
}
10+
if (!iconSvg) return ''
1311
try {
14-
const decodedSvg = Buffer.from(iconSvg, 'base64').toString('utf-8')
15-
const dataUri = `data:image/svg+xml;base64,${decodedSvg}`
12+
// If iconSvg is base64-of-base64, unwrap once
13+
const maybeInner = Buffer.from(iconSvg, 'base64').toString('utf8')
14+
const payload =
15+
/^[A-Za-z0-9+/=\n\r]+$/.test(maybeInner) && !maybeInner.trim().startsWith('<')
16+
? maybeInner // double-encoded → use inner base64
17+
: iconSvg // single-encoded → already fine
18+
19+
const dataUri = `data:image/svg+xml;base64,${payload}`
1620
return `<link rel="icon" type="image/svg+xml" href="${dataUri}">`
17-
} catch (error) {
18-
console.error('Error processing icon SVG:', error)
21+
} catch (e) {
22+
console.error('Error processing icon SVG:', e)
1923
return ''
2024
}
2125
}

server/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ app.get(`${basePrefix ? basePrefix : ''}/env.js`, (_, res) => {
213213
window._env_ = {
214214
${basePrefix ? ` BASEPREFIX: "${basePrefix}",` : ''}
215215
TITLE_TEXT: ${JSON.stringify(TITLE_TEXT) || '"check envs"'},
216-
LOGO_TEXT: ${JSON.stringify(LOGO_TEXT) || '"check envs"'},
216+
LOGO_TEXT: ${LOGO_TEXT !== undefined ? JSON.stringify(LOGO_TEXT) : '"check envs"'},
217217
FOOTER_TEXT: ${JSON.stringify(FOOTER_TEXT) || '"check envs"'},
218218
${CUSTOM_LOGO_SVG ? ` CUSTOM_LOGO_SVG: "${CUSTOM_LOGO_SVG}",` : ''}
219219
${CUSTOM_TENANT_TEXT ? ` CUSTOM_TENANT_TEXT: "${CUSTOM_TENANT_TEXT}",` : ''}

0 commit comments

Comments
 (0)