I want to create a CSP page that returns a pdf. The pdf is identified by a pdftoken parameter.
My goal is to validate the token and return the pdf (ContentType=”application/pdf”) if the token is good and return a text error message "Bad Token" (ContentType=”text/plain”) if the token is missing or bad.
My issue seems to be associated with ContentType. I can define one ContentType that works for the pdf or the error message. I am unable to change the ContentType.
Any assistance is appreciated.
ClassMethod OnPage() As %Status { set pdfToken=$get(%request.