mirror of
https://github.com/go-shiori/shiori.git
synced 2025-09-08 14:05:54 +08:00
fix invalid assets path when use webroot (#448)
Co-authored-by: hulb <hulb@RD-NeoHu.netis.com.cn>
This commit is contained in:
parent
f000f11bfa
commit
7e1824a8b5
1 changed files with 3 additions and 1 deletions
|
@ -14,9 +14,10 @@ import (
|
|||
"strings"
|
||||
|
||||
"github.com/PuerkitoBio/goquery"
|
||||
"github.com/go-shiori/shiori/internal/model"
|
||||
"github.com/go-shiori/warc"
|
||||
"github.com/julienschmidt/httprouter"
|
||||
|
||||
"github.com/go-shiori/shiori/internal/model"
|
||||
)
|
||||
|
||||
// serveFile is handler for general file request
|
||||
|
@ -24,6 +25,7 @@ func (h *handler) serveFile(w http.ResponseWriter, r *http.Request, ps httproute
|
|||
rootPath := strings.Trim(h.RootPath, "/")
|
||||
urlPath := strings.Trim(r.URL.Path, "/")
|
||||
filePath := strings.TrimPrefix(urlPath, rootPath)
|
||||
filePath = strings.Trim(filePath, "/")
|
||||
|
||||
err := serveFile(w, filePath, true)
|
||||
checkError(err)
|
||||
|
|
Loading…
Add table
Reference in a new issue