koajs / koa-range

[MAINTAINERS WANTED] range request implementation for koa, see http://tools.ietf.org/html/rfc7233
50 stars 12 forks source link

Giving an error with empty body #7

Closed unicornborn closed 8 years ago

unicornborn commented 8 years ago

I'm using koa-range with koa-better-static, and the user is making a request with

if-modified-since:Fri, 01 Apr 2016 18:21:16 GMT
range:bytes=15110-6381395

koa-better-static returns 304 NOT MODIFIED with an empty body because the file has not been modified since that date, but now koa-range tries to access this.body.length which throws an error as its dereferencing undefined

yorkie commented 8 years ago

@unicornborn please try to apply https://github.com/koajs/koa-range/pull/8.patch and see if it works on your project, thank you :-)

yorkie commented 8 years ago

Try with 0.2.1 :-)