dwhly-proj / droppdf

105 stars 18 forks source link

ePub loading doesn't work (probably due to escaped symbols in bookUrl) #135

Open garlicbreadcleric opened 1 year ago

garlicbreadcleric commented 1 year ago

GET https://s3.us-central-1.wasabisys.com/docdrop-annotations-prod/russell_problemsphilosophy_en_2004-qcyf4.epub?AWSAccessKeyId=...&Signature=...=&Expires=... fails with 400 Bad Request. Replacing & with & in URL fixes the issue. It appears to be because of escaping of book_url in epub.html template. I haven't tried running the server locally, but in theory the following change should fix the issue:

   <script>
+  {% autoescape off %}
     window.bookUrl = "{{ book_url }}";
+  {% endautoescape %}
   </script>

https://stackoverflow.com/questions/18345867/how-to-stop-django-template-code-from-escaping