@kiyasov/platform-hono 1.3.1 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiyasov/platform-hono",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "Nest adapter for Hono",
5
5
  "author": "Islam Kiiasov",
6
6
  "repository": {
@@ -263,6 +263,17 @@ export class HonoAdapter extends AbstractHttpAdapter<
263
263
 
264
264
  public initHttpServer(options: NestApplicationOptions) {
265
265
  this.instance.use((ctx, next) => {
266
+ ctx.req["ip"] =
267
+ ctx.req.header("cf-connecting-ip") ??
268
+ ctx.req.header("x-forwarded-for") ??
269
+ ctx.req.header("x-real-ip") ??
270
+ ctx.req.header("forwarded") ??
271
+ ctx.req.header("true-client-ip") ??
272
+ ctx.req.header("x-client-ip") ??
273
+ ctx.req.header("x-cluster-client-ip") ??
274
+ ctx.req.header("x-forwarded") ??
275
+ ctx.req.header("forwarded-for") ??
276
+ ctx.req.header("via");
266
277
  ctx.req["query"] = ctx.req.query() as any;
267
278
  ctx.req["headers"] = Object.fromEntries(ctx.req.raw.headers);
268
279