koajs / ratelimit

Rate limiter middleware
MIT License
485 stars 57 forks source link

TypeError: Cannot read properties of undefined (reading 'remoteAddress') #67

Closed dong-lufei closed 11 months ago

dong-lufei commented 1 year ago
$ deno run -A index.js
http://localhost:3000

  TypeError: Cannot read properties of undefined (reading 'remoteAddress')
      at Object.get ip (file:///C:/Users/13697/AppData/Local/deno/npm/registry.npmjs.org/koa/2.14.1/lib/request.js:456:45)
      at Object.ip (file:///C:/Users/13697/AppData/Local/deno/npm/registry.npmjs.org/delegates/1.0.0/index.js:72:24)
      at Object.id (file:///E:/test/deno/deno01/index.js:168:20)
      at ratelimit (file:///C:/Users/13697/AppData/Local/deno/npm/registry.npmjs.org/koa-ratelimit/5.0.1/index.js:57:21)
      at dispatch (file:///C:/Users/13697/AppData/Local/deno/npm/registry.npmjs.org/koa-compose/4.2.0/index.js:47:32)
      at file:///C:/Users/13697/AppData/Local/deno/npm/registry.npmjs.org/koa-compose/4.2.0/index.js:39:12
      at Application.handleRequest (file:///C:/Users/13697/AppData/Local/deno/npm/registry.npmjs.org/koa/2.14.1/lib/application.js:182:12)
      at ServerImpl.handleRequest (file:///C:/Users/13697/AppData/Local/deno/npm/registry.npmjs.org/koa/2.14.1/lib/application.js:157:19)
      at ServerImpl.emit (https://deno.land/std@0.174.0/node/_events.mjs:379:28)
      at https://deno.land/std@0.174.0/node/http.ts:634:16

  TypeError: Cannot read properties of undefined (reading 'remoteAddress')
      at Object.get ip (file:///C:/Users/13697/AppData/Local/deno/npm/registry.npmjs.org/koa/2.14.1/lib/request.js:456:45)
      at Object.ip (file:///C:/Users/13697/AppData/Local/deno/npm/registry.npmjs.org/delegates/1.0.0/index.js:72:24)
      at Object.id (file:///E:/test/deno/deno01/index.js:168:20)
      at ratelimit (file:///C:/Users/13697/AppData/Local/deno/npm/registry.npmjs.org/koa-ratelimit/5.0.1/index.js:57:21)
      at dispatch (file:///C:/Users/13697/AppData/Local/deno/npm/registry.npmjs.org/koa-compose/4.2.0/index.js:47:32)
      at file:///C:/Users/13697/AppData/Local/deno/npm/registry.npmjs.org/koa-compose/4.2.0/index.js:39:12
      at Application.handleRequest (file:///C:/Users/13697/AppData/Local/deno/npm/registry.npmjs.org/koa/2.14.1/lib/application.js:182:12)
      at ServerImpl.handleRequest (file:///C:/Users/13697/AppData/Local/deno/npm/registry.npmjs.org/koa/2.14.1/lib/application.js:157:19)
      at ServerImpl.emit (https://deno.land/std@0.174.0/node/_events.mjs:379:28)
      at https://deno.land/std@0.174.0/node/http.ts:634:16
titanism commented 11 months ago

This is not a bug related to this project.