-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PDF files not showing in renderer #8294
Comments
As I found in #8299 some external rendering was broken by 867f46f, not sure if it would have affected PDF files, but may be worth checking. It looks as if PDFs are handled in different cases in the switch: Lines 274 to 345 in c6fb7fe
Once the case is handled it is processed by the template at: gitea/templates/repo/view_file.tmpl Lines 48 to 70 in 867f46f
Edit: However, unhelpfully, I tested it on my install of |
Yeah the generated HTML looks good and seems ok. I'm trying to figure out why the headers are setting X-Frame-Options to DENY instead of SAMEORIGIN only for the PDF.js links. Do you have any idea why this would be different than the headers of the rest of the site? |
@mehalter Since I'm not having any issues on my side I wonder if it could be your browser? Have you tried from different browsers/clients? Some browsers/browser extensions make changes that interfere with iframes for security reasons. |
Yeah I had that thought too, and it is broken on all browsers/clients that I have tried on several devices. |
Is there anything in the codebase that would have the pdf.js link be assigned different headers? the |
Which browser are you using? |
I have tried with Firefox and qutebrowser on linux, and firefox and chrome on android. |
@mehalter #8300 has some code changes about rendering external files. Could that fix your problem? You can checkout that PR by using:
But you need to check in a testing environment; otherwise it might wreck havoc in your installation (there was a bug in migrations that deleted the attachments from the file system and I don't know if the fix has been merged into this particular PR yet). |
Or perhaps you could attempt applying that commit individually? It would be safer and you'd skip migrations, etc. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions. |
This issue has been automatically closed because of inactivity. You can re-open it if needed. |
[x]
):Description
PDF Files are not showing in the renderer, the
/vendor/plugins/pdfjs/web/viewer.html?file=...pdf
request hasX-Frame-Options: DENY
header. I can follow the link and serve the file, but the header option doesn't allow it to be in theiframe
. When I set the headers in my apache config, it doesn't apply to the/vendor/plugins/pdfjs/web/viewer.html?file=....pdf
requests.Screenshots
The text was updated successfully, but these errors were encountered: