Set proxy setting on Koa application.

This commit is contained in:
Sam Rose 2024-10-09 13:34:43 +01:00
parent f4aeb801d2
commit 26f2deb234
No known key found for this signature in database
3 changed files with 4 additions and 0 deletions

View File

@ -198,6 +198,8 @@ export class FlagSet<V extends Flag<any>, T extends { [key: string]: V }> {
let userId = identity?._id
if (!userId) {
const ip = context.getIP()
// TODO; REMOVE THIS
tags["userIP"] = ip
if (ip) {
userId = crypto.createHash("sha512").update(ip).digest("hex")
}

View File

@ -12,6 +12,7 @@ import { userAgent } from "koa-useragent"
export default function createKoaApp() {
const app = new Koa()
app.proxy = true
let mbNumber = parseInt(env.HTTP_MB_LIMIT || "10")
if (!mbNumber || isNaN(mbNumber)) {

View File

@ -46,6 +46,7 @@ bootstrap()
const app: Application = new Application()
app.keys = ["secret", "key"]
app.proxy = true
// set up top level koa middleware
app.use(handleScimBody)