question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support HOSTED_VIEWER_ORIGINS checking with wildcard

See original GitHub issue

Attach (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:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
Snuffleupaguscommented, Jan 8, 2020

Well, I think it’s just basic string manipulation, but up to you guys I guess…

In that case, please show how you’d expect this to work 😃 Please keep in mind though: You’ll need to compare actually valid URLs, rather than raw strings, in order for the solution to (generally) safe.

0reactions
Songyu-Wangcommented, Jan 8, 2020

Well, I think it’s just basic string manipulation, but up to you guys I guess…

Read more comments on GitHub >

github_iconTop Results From Across the Web

CORS: Cannot use wildcard in Access-Control-Allow-Origin ...
Cannot use wildcard in Access-Control-Allow-Origin when credentials flag is true. doesn't work on firefox either. My Node.js setup is: var allowCrossDomain = ...
Read more >
Wildcard characters allow searching for patterns and variations
Expand search results to match any non-space character. The system supports both single-character and multiple-character wildcards.
Read more >
Values that you specify when you create or update a distribution
When you use the CloudFront console to create a new distribution or update an existing distribution, you specify the following values.
Read more >
Common Name (CN) for a wildcard certificate
These certificates use a wildcard character (*) in the domain name field to secure numerous subdomains (hosts) linked to the same base domain....
Read more >
Origin CA certificates - SSL/TLS - Cloudflare Docs
List the hostnames (including wildcards) the certificate should ... If all your origin hosts are protected by Origin CA certificates or ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found