Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF not working #48

Open
jfaraklit opened this issue Oct 22, 2018 · 3 comments
Open

PDF not working #48

jfaraklit opened this issue Oct 22, 2018 · 3 comments

Comments

@jfaraklit
Copy link

jfaraklit commented Oct 22, 2018

When trying to get PDF, the PDF is coming blank. Tried adding 'application/pdf' in the list of mime types. Any thoughts? Html and CSS and images can be served.

@pspEgg
Copy link

pspEgg commented Dec 31, 2018

@ajshukury a workaround (with a big side effect)

create a separate project JUST for the pdf generating endpoint, then:

adding */* to types will work for PDF.

If you have other functions in the same project: Your other functions will be affected as everything will be treated as binary.

So if you use this workaround, create a separate Serverless.yml for it (in order to create a separate API Gateway)

Something else you should know: once you publish a function with */* you cannot undo it, meaning even if you switch back to application/pdf your other normal functions will still be affected. I have also tried manually editing the API gateway binary MIME types in the AWS Console, it cannot be deleted.

@JaredAAT
Copy link

JaredAAT commented May 5, 2021

adding / to types will work for PDF.

If you have other functions in the same project: Your other functions will be affected as everything will be treated as binary.

it's 2021... Has anyone found a better way of doing this? adding */* to deal with serving PDF content, still massively breaks any other functions within a serveless.yml file

@pspEgg
Copy link

pspEgg commented May 5, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants