mirror of
https://github.com/pockethost/pockethost.git
synced 2025-03-30 15:08:30 +00:00
enh: add requestId to locals
This commit is contained in:
parent
0a2ab02fad
commit
0bd29824d2
@ -53,6 +53,7 @@ export const proxyService = mkSingleton(async (config: ProxyServiceConfig) => {
|
||||
// Default locals
|
||||
server.use((req, res, next) => {
|
||||
const host = req.headers.host
|
||||
res.locals.requestId = seqid()
|
||||
res.locals.host = host
|
||||
res.locals.coreInternalUrl = coreInternalUrl
|
||||
next()
|
||||
@ -65,7 +66,7 @@ export const proxyService = mkSingleton(async (config: ProxyServiceConfig) => {
|
||||
const ip = (req.headers['x-forwarded-for'] as string) || '<ip>'
|
||||
const method = req.method || '<m>'
|
||||
const sig = [
|
||||
seqid(),
|
||||
res.locals.requestId,
|
||||
method.padStart(10),
|
||||
country.padStart(5),
|
||||
ip.padEnd(45),
|
||||
|
Loading…
x
Reference in New Issue
Block a user