Skip to content

When saving an LFS PDF file on Minio, the PDF preview may fail when SERVE_DIRECT is set to true. #30487

@dangjinghao

Description

@dangjinghao

Description

i configured the [storage] section of configuration so that save most huge file on Minio (Cloudflare R2).
(set SERVE_DIRECT = true)

I have a repository that tracing a .pdf file as LFS. After I pushed this repository and previewed this pdf file on gitea website. the browser simply downloaded the PDF without providing an inline preview.

Then I created a demo that test the performance of pdfobj (the previewer gitea used) on Minio.I found That:

  • The Content-Disposition must set to inline
  • Content-type should be application/pdf

in Minio url header.

There is a demo on my private site, <removed>

I’ve addressed this issue in my fork, but the fix involved numerous code changes to implement my solution. I’m uncertain whether this approach is optimal.

Gitea Version

1.23.0+dev-129-gef3941f2e and 1.21.10

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

docker-compose and gitea:nightly or gitea:latest

Database

SQLite

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions