]> source.dussan.org Git - gitea.git/commitdiff
Fix 404 error viewing the LFS file (#22945)
authorZettat123 <zettat123@gmail.com>
Fri, 17 Feb 2023 03:55:33 +0000 (11:55 +0800)
committerGitHub <noreply@github.com>
Fri, 17 Feb 2023 03:55:33 +0000 (11:55 +0800)
Fix #22734.

According to
[`view_file.tmpl`](https://github.com/go-gitea/gitea/blob/main/templates/repo/view_file.tmpl#L82),
`lfs_file.tmpl` should use `AssetUrlPrefix` instead of `AppSubUrl`.

Co-authored-by: Jason Song <i@wolfogre.com>
templates/repo/settings/lfs_file.tmpl

index eb67de20a0187d31c7837e2b668264f6ac08e2a1..54b40bd00400fd830fb50a99acac0cd9d84d04a5 100644 (file)
@@ -35,7 +35,7 @@
                                                                        <strong>{{.locale.Tr "repo.audio_not_supported_in_browser"}}</strong>
                                                                </audio>
                                                        {{else if .IsPDFFile}}
-                                                               <iframe width="100%" height="600px" src="{{AppSubUrl}}/vendor/plugins/pdfjs/web/viewer.html?file={{$.RawFileLink}}"></iframe>
+                                                               <iframe width="100%" height="600px" src="{{AssetUrlPrefix}}/vendor/plugins/pdfjs/web/viewer.html?file={{$.RawFileLink}}"></iframe>
                                                        {{else}}
                                                                <a href="{{$.RawFileLink}}" rel="nofollow" class="btn btn-gray btn-radius">{{.locale.Tr "repo.file_view_raw"}}</a>
                                                        {{end}}