         return res.end()
     if req.headers['range']
       statusCode = 206  # partial data
-      parts = req.headers["range"].replace(/bytes=/, "").split("-")
+      parts = req.headers['range'].replace(/bytes=/, "").split("-")
       start = parseInt(parts[0], 10)
       end = (if parts[1] then parseInt(parts[1], 10) else req.gridFS.length - 1)
       if (start < 0) or (end >= req.gridFS.length) or (start > end) or isNaN(start) or isNaN(end)

    headers =
      'Content-Type': 'text/plain'
      'Cache-Control': 'stale-while-revalidate'
    if req.headers['if-modified-since']
      since = Date.parse req.headers['if-modified-since']  ## NaN if invaild
      if since and req.gridFS.uploadDate and (req.headers['if-modified-since'] == req.gridFS.uploadDate.toUTCString() or since >= req.gridFS.uploadDate.getTime())

        .on 'close', () ->
          res.end()
        .on 'error', (err) ->
          res.writeHead 500
          res.end err
    else
      res.writeHead 410
      res.end()
