* Returns the request `headers` that will be sent to the Lambda.
(
req: http.IncomingMessage,
requestId: string,
xfwd: boolean
)
| 1500 | * Returns the request `headers` that will be sent to the Lambda. |
| 1501 | */ |
| 1502 | getProxyHeaders( |
| 1503 | req: http.IncomingMessage, |
| 1504 | requestId: string, |
| 1505 | xfwd: boolean |
| 1506 | ): http.IncomingHttpHeaders { |
| 1507 | const ip = this.getRequestIp(req); |
| 1508 | const { host } = req.headers; |
| 1509 | const headers: http.IncomingHttpHeaders = { |
| 1510 | connection: 'close', |
| 1511 | 'x-real-ip': ip, |
| 1512 | 'x-vercel-deployment-url': host, |
| 1513 | 'x-vercel-forwarded-for': ip, |
| 1514 | 'x-vercel-id': requestId, |
| 1515 | }; |
| 1516 | if (xfwd) { |
| 1517 | headers['x-forwarded-host'] = host; |
| 1518 | headers['x-forwarded-proto'] = 'http'; |
| 1519 | headers['x-forwarded-for'] = ip; |
| 1520 | } |
| 1521 | return headers; |
| 1522 | } |
| 1523 | |
| 1524 | private getServiceRouteTable(serviceName: string): Route[] { |
| 1525 | if (!this.serviceRoutesTable) { |
no test coverage detected