Skip to content

Commit 5e965dd

Browse files
committed
fix: use autoDoctype full option to ensure proper HTML Content-Type header
1 parent 9e8c53a commit 5e965dd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { authenticator } from 'otplib'
55
import QRCode from 'qrcode'
66
import { writeFile } from 'node:fs/promises'
77
import { readFileSync, existsSync } from 'node:fs'
8-
import { html, Html } from '@elysiajs/html'
8+
import { html } from '@elysiajs/html'
99

1010
// Import core modules
1111
import { createSessionManager } from './core/session.js'
@@ -76,7 +76,7 @@ export const r2Backup = initialConfig => app => {
7676
// Setup initial cron schedule
7777
scheduler.setup(config.cronSchedule, config.cronEnabled !== false)
7878

79-
return app.use(html()).group('/backup', app => {
79+
return app.use(html({ autoDoctype: 'full' })).group('/backup', app => {
8080
// Authentication Middleware
8181
const authMiddleware = context => {
8282
// Skip auth entirely if no valid config (needs onboarding)
@@ -138,7 +138,7 @@ export const r2Backup = initialConfig => app => {
138138
return
139139
}
140140

141-
return Html(LoginPage({ totpEnabled: !!config.auth?.totpSecret }))
141+
return LoginPage({ totpEnabled: !!config.auth?.totpSecret })
142142
})
143143

144144
// AUTH: Login Endpoint
@@ -452,7 +452,7 @@ export const r2Backup = initialConfig => app => {
452452
set.headers['Location'] = '/backup'
453453
return
454454
}
455-
return Html(OnboardingPage({ sourceDir: config.sourceDir }))
455+
return OnboardingPage({ sourceDir: config.sourceDir })
456456
})
457457

458458
// ONBOARDING: Save Initial Config
@@ -535,7 +535,7 @@ export const r2Backup = initialConfig => app => {
535535

536536
const jobStatus = scheduler.getStatus(config.cronEnabled)
537537
const hasAuth = !!(config.auth && config.auth.username && config.auth.password)
538-
return Html(DashboardPage({ config, jobStatus, hasAuth }))
538+
return DashboardPage({ config, jobStatus, hasAuth })
539539
})
540540
)
541541
})

0 commit comments

Comments
 (0)