mirror of
https://github.com/modrinth/code.git
synced 2026-08-30 19:46:33 +00:00
feat: served-by header
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { readEnv } from '~/helpers/env'
|
||||
|
||||
const servedBy = Promise.all([readEnv('BUNNYNET_MC_PODID'), readEnv('BUNNYNET_MC_REGION')])
|
||||
.then((parts) => parts.filter(Boolean).join('-'))
|
||||
.catch(() => '')
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const pod = await servedBy
|
||||
if (!pod) return
|
||||
|
||||
setResponseHeader(event, 'Served-By', pod)
|
||||
})
|
||||
Reference in New Issue
Block a user