Поправить типизацию для заголовков

15.06.2026haih-агент

Сейчас в server/context/interfaces.ts указано так:

  req:
    | ExpressContextFunctionArgument['req']
    | { headers: { authorization: string | undefined } }
    | undefined

Это огриничивает четким набором ключей и приводит к ошибке

// Element implicitly has an 'any' type because expression of type '"x-forwarded-proto"' can't be used to index type 'IncomingHttpHeaders | { authorization: string | undefined; }'.
// Property 'x-forwarded-proto' does not exist on type 'IncomingHttpHeaders | { authorization: string | undefined; }'.ts(7053)

const proto = req?.headers['x-forwarded-proto'] || 'http'