Support HOSTED_VIEWER_ORIGINS checking with wildcard
See original GitHub issueAttach (recommended) or Link to PDF file here: N/A Configuration:
- Web browser and its version: irrelevant
- Operating system and its version: irrelevant
- PDF.js version: newest
- Is a browser extension: irrelevant
Steps to reproduce the problem: N/A
What is the expected behavior? (add screenshot)
Is it a good idea to support wildcard check?
For example:
HOSTED_VIEWER_ORIGINS = ['*-myCompany.amazonaws.com']
instead of
HOSTED_VIEWER_ORIGINS = ['test-myCompany.amazonaws.com','production-myCompany.amazonaws.com']
What went wrong? (add screenshot)
My use case for pdf.js is to embed a pdf to our website. The pdf file is consumed from s3 bucket.
In order to make it work, I have to modify HOSTED_VIEWER_ORIGINS
to add the s3 url,
but in practice, it is not that easy since we have different stacks consume files from different buckets. Listing all possible buckets seems not like a good practice.
Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension): N/A
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top GitHub Comments
In that case, please show how you’d expect this to work 😃 Please keep in mind though: You’ll need to compare actually valid
URL
s, rather than raw strings, in order for the solution to (generally) safe.Well, I think it’s just basic string manipulation, but up to you guys I guess…