Impossible to provide a pdf in wiki via git access

Summary

Adding a .pdf (or probably many other file types) to the wiki doesn't work since the rendering is blocked.

Steps to reproduce

  1. Create a wiki
  2. git clone it, add a pdf file
  3. try accessing the file via gitlab UI

Or see https://gitlab.com/anton-akhmerov/test/wikis/uploads/test.pdf

Expected behavior

When hitting the file URL it gets downloaded (due to content-disposition). This would happen if the file is attached via "attach file" element of the gitlab wiki edit UI.

Actual behavior

The file does not open at all, with the following errors in js console:

Refused to apply inline style because it violates the following Content Security Policy directive: "default-src 'none'". Either the 'unsafe-inline' keyword, a hash ('sha256-xxx'), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'style-src' was not explicitly set, so 'default-src' is used as a fallback.

test.pdf:1 Refused to load plugin data from 'https://gitlab.com/anton-akhmerov/test/wikis/uploads/test.pdf' because it violates the following Content Security Policy directive: "default-src 'none'". Note that 'object-src' was not explicitly set, so 'default-src' is used as a fallback.

Output of checks

This bug happens on GitLab.com

Assignee Loading
Time tracking Loading