Uploaded image for project: 'Archive of Our Own'
  1. AO3-5188

ePubs downloading as zip files or opening as gibberish in the browser when other files for that work have been generated

    Details

    • Type: Bug
    • Status: Deployed
    • Priority: High
    • Resolution: DeployedToBeta
    • Affects Version/s: 0.9.204
    • Fix Version/s: 0.9.205
    • Milestone:
      Internal 0.9
    • Difficulty:
      Medium
    • Roadmap:
      Export
    • Components:
      BackEnd

      Description

      We've received numerous complaints, across all browsers and platforms, of ePub files for works download as zip files, or simply opening in the browser as gibberish:

      It appears that if the ePub is not the first file generated (e.g. the HTML file exists), the content type is incorrectly set to text/plain:

      curl -I http://ao3-app98:7084/downloads/Cr/Creator/2592860/File%20Name.epub
      HTTP/1.1 200 OK
      Date: Sun, 24 Sep 2017 08:20:56 GMT
      Connection: close
      Last-Modified: Sun, 24 Sep 2017 08:20:36 GMT
      Content-Type: text/plain
      Content-Length: 18965
      

      It should look like:

      curl -I http://ao3-app98:7084/downloads/Cr/Creator/2592860/File%20Name.epub
      HTTP/1.1 200 OK
      Date: Sun, 24 Sep 2017 08:20:36 GMT
      Connection: close
      X-Frame-Options: SAMEORIGIN
      X-XSS-Protection: 1; mode=block
      X-Content-Type-Options: nosniff
      Content-Type: application/epub+zip
      Content-Disposition: attachment; filename="File Name.epub"
      Content-Transfer-Encoding: binary
      Cache-Control: private
      X-Request-Id: 20f2e13b-f870-46f7-a7cb-e1df60782ed1
      X-Runtime: 0.695178
      Transfer-Encoding: chunked
      

      This is caused by the file cache. Because we have other types of caching, we'd like to remove this one.

      The problem isn't reproducible outside production, so just make sure downloads still work on staging, and then we'll see if this resolves the issue on production.

        Attachments

          Activity

            People

            • Assignee:
              zz9pzza2 james_
              Reporter:
              zz9pzza2 james_
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: