mirror of
https://github.com/miniflux/v2.git
synced 2025-08-01 17:38:37 +00:00
Avoid extra HTTP request for fetching custom stylesheet
Use inline CSS with a nonce and move CSP headers to a meta tag.
This commit is contained in:
parent
09be3d2bac
commit
dd3f496d06
5 changed files with 14 additions and 21 deletions
|
@ -16,19 +16,6 @@ import (
|
|||
|
||||
func (h *handler) showStylesheet(w http.ResponseWriter, r *http.Request) {
|
||||
filename := request.RouteStringParam(r, "name")
|
||||
if filename == "custom_css" {
|
||||
user, err := h.store.UserByID(request.UserID(r))
|
||||
if err != nil || user == nil {
|
||||
html.NotFound(w, r)
|
||||
return
|
||||
}
|
||||
b := response.New(w, r)
|
||||
b.WithHeader("Content-Type", "text/css; charset=utf-8")
|
||||
b.WithBody(user.Stylesheet)
|
||||
b.Write()
|
||||
return
|
||||
}
|
||||
|
||||
etag, found := static.StylesheetBundleChecksums[filename]
|
||||
if !found {
|
||||
html.NotFound(w, r)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue