Explore Courses Blog Tutorials Interview Questions
0 votes
in AWS by (19.1k points)

I'm trying to use pdf.js with range requests (progressive loading of the pdf document), but when I'm trying to load the pdf from amazon s3 urls this error appears in the console :

-Refused to get unsafe header "Accept-Ranges"

and the pdf doesn't load via 206 partial content (range requests) but 200 and then viewed in the viewer.

1 Answer

0 votes
by (44.4k points)

Set your Amazon CORS policy like this:

<?xml version="1.0" encoding="UTF-8"?>

<CORSConfiguration xmlns="">








        <!-- this part is critical -->




        <ExposeHeader>Content-Length </ExposeHeader>




This might help.

Related questions

0 votes
1 answer

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
asked Aug 14, 2019 in Web Technology by Sammy (47.6k points)
0 votes
1 answer
asked Jan 2, 2021 in Python by laddulakshana (16.4k points)
0 votes
1 answer
0 votes
1 answer

Browse Categories