webodf / ViewerJS

ViewerJS: Document Reader in JavaScript
http://viewerjs.org
1.94k stars 421 forks source link

S3 HEAD method forbidden #243

Open quytang opened 6 years ago

quytang commented 6 years ago

Case

  1. I use viewerjs for viewing PDF file.
  2. PDF file url will be expired at a specific time, and pdf file is s3 private. I generate the presigned url to solve it.
  3. PDF viewer needs to call HEAD method to determine the content type of PDF file. Then It calls GET to get the content and show it.

Unfortunately, presigned url only allowed to sign one method. Therefore the url passed to viewerjs only supports GET this makes HEAD call failed.