alvarcarto / url-to-pdf-api

Web page PDF/PNG rendering done right. Self-hosted service for rendering receipts, invoices, or any content.
MIT License
7.03k stars 779 forks source link

Are get links allowed ? #157

Closed harismuntazir closed 3 years ago

harismuntazir commented 3 years ago

I Tried to get this url https://url-to-pdf-api.herokuapp.com/api/render?url=https://egov.uok.edu.in/courseinfo/ugforms/prelogin/default2_wdsubnames.aspx?id=113994&courseyear=4

but it resulted in the following error..

{"status":400,"statusText":"Bad Request","errors":[{"field":["courseyear"],"location":"query","messages":["\"courseyear\" is not allowed"],"types":["object.allowUnknown"]}]}

What could be the problem

cdwiegand commented 3 years ago

Try url encoding the requested url (you have two ?s, the second should already be url encoded).

Gunyon commented 3 years ago

Like this: https://url-to-pdf-api.herokuapp.com/api/render?url=https://egov.uok.edu.in/courseinfo/ugforms/prelogin/default2_wdsubnames.aspx%3Fid=113994%26courseyear=4

second ? replaced with %3F & replaced with %26

https://secure.n-able.com/webhelp/NC_9-1-0_SO_en/Content/SA_docs/API_Level_Integration/API_Integration_URLEncoding.html

kimmobrunfeldt commented 3 years ago

The demo has been limited to work with only certain URLs for security reasons. You can deploy the app on your own infra to get all access.