koopjs / koop

Transform, query, and download geospatial data on the web.
http://koopjs.github.io
Other
654 stars 125 forks source link

writeHead in send-pbf causes errors #922

Closed Cartobin closed 4 months ago

Cartobin commented 4 months ago

When using koop as express middleware the current

res.writeHead(200, [
    ['content-type', 'application/x-protobuf'],
    ['content-length', buffer.length],
    ['content-disposition', `inline;filename=${FILENAME}`],
  ]);

on line 20 of packages/featureserver/src/response-handlers/helpers/send-pbf/index.js causes a header error. Locally, I tested a fix by using

res.set('content-type', 'application/x-protobuf'),
res.set('content-length', buffer.length),
res.set('content-disposition', `inline;filename=${FILENAME}`)
res.status(200)

in its place and it returned a pbf.

rgwozdz commented 4 months ago

Hello @Cartobin, thanks for posting this. Not doubting you, but we haven't seen it in our demo's or tests, so I am curious about the specific error. Can you post it if you still have it?

rgwozdz commented 4 months ago

@Cartobin, see https://github.com/koopjs/koop/pull/950