tobinbradley/dirt-simple-postgis-http-api

Response status is pending

Closed this issue · 3 comments

Hello, I'm trying to get geojson data, all requests works fine besides request when no data. in that requests their responses statuses always is pending.

Quick look for code showed me the response code must be 204 when result.rows.length === 0, but 204 not back

Thanks for reporting the issue! I can confirm it.

Adding an empty send (i.e. reply.code(204).send()) seems to do the trick. I suspect Fastify changed that behavior in an update and I missed it (I can't imagine this has never worked properly), but adding an explicit send works. The response body is still empty, which is perfect.

I updated the 204 results for geojson, geobuff, and mvt. Give it a shot and if it doesn't fix the problem let me know.

Thanks again for reporting it!

Everything works great. I am very grateful to you, thank you very much

No worries!