tmp logging

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-11-17 14:40:01 +01:00
parent 56c74e13ff
commit aa8765d627
6 changed files with 25 additions and 14 deletions

View File

@@ -22,7 +22,7 @@ export type OpenpanelOptions = OpenPanelOptions & {
export default function createMiddleware(options: OpenpanelOptions) {
return function middleware(req: Request, res: Response, next: NextFunction) {
const sdk = new OpenPanel(options);
const ip = getClientIpFromHeaders(req.headers);
const { ip } = getClientIpFromHeaders(req.headers);
if (ip) {
sdk.api.addHeader('x-client-ip', ip);
}