serverless-apigw-binary icon indicating copy to clipboard operation
serverless-apigw-binary copied to clipboard

PDF not working

Open jfaraklit opened this issue 7 years ago • 3 comments

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.

jfaraklit avatar Oct 22 '18 16:10 jfaraklit

@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.

pspEgg avatar Dec 31 '18 02:12 pspEgg

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

JaredAAT avatar May 05 '21 18:05 JaredAAT

split pdf function into its own serverless project.

On Wed, May 5, 2021 at 11:01 AM JaredAAT @.***> wrote:

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

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/maciejtreder/serverless-apigw-binary/issues/48#issuecomment-832895070, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMM2WBAXMSCU7S3DFC6YL3TMGBW7ANCNFSM4F6O5MFQ .

pspEgg avatar May 05 '21 18:05 pspEgg