pdf-rendering-srv
pdf-rendering-srv copied to clipboard
HTTP support
It looks like the rewrite only supports HTTPS, but I can't see how I can configure SSL for the service, and it only appears to expose a port which is running an HTTP server. Am I missing something?
e.g. if I run this:
docker run -p 9000:9000 -it --rm restorecommerce/pdf-rendering-srv:latest
and use cURL as per the docs:
curl -o google.pdf -v -XGET https://localhost:9000/api/render?url=http://google.com
I see this in the logs:
2024-04-20T19:05:10.900Z - warn: [error-logger.js] Request parameters:
2024-04-20T19:05:10.900Z - warn: [error-logger.js] Request body:
2024-04-20T19:05:10.900Z - warn: [error-logger.js] Error: Only HTTPS allowed.
2024-04-20T19:05:40.932Z - warn: [error-logger.js] Request headers: host=localhost:9000, user-agent=curl/7.68.0, accept=*/*
I imagine that a common scenario is that one would run an HTTP proxy / API gateway in front of this container that handles the HTTPS, so it would be nice to have an HTTP only option.
I don't understand how you can even call port 9000 if it is not exposed in Dockerfile. As far as I understand this project works only with gRPC, not HTTP API
@barrypitman as you can see in the Docs, it is not an HTTPS service anymore, it was. Now it only offers a gRPC interface. For now we don't plan to go back to HTTPS. Feel free to create a PR for this.