mirror of
https://github.com/Luzifer/ots.git
synced 2025-05-02 14:26:17 -04:00
Generate SRI integrity hashes into html
to prevent loading of scripts which were modified on the network transport Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
a7c4c584cc
commit
7aaf7a7f53
5 changed files with 163 additions and 139 deletions
4
main.go
4
main.go
|
@ -1,6 +1,6 @@
|
|||
package main
|
||||
|
||||
//go:generate go-bindata -pkg $GOPACKAGE -o assets.go ./frontend/...
|
||||
//go:generate go-bindata -pkg $GOPACKAGE -o assets.go -modtime 1 -md5checksum ./frontend/...
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
@ -81,7 +81,7 @@ func assetDelivery(res http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
tpl, err := template.New(assetName).Funcs(getTFuncMap(r)).Parse(string(assetData))
|
||||
tpl, err := template.New(assetName).Funcs(addTranslateFunc(tplFuncs, r)).Parse(string(assetData))
|
||||
|
||||
if err != nil {
|
||||
log.Errorf("Template for asset %q has an error: %s", assetName, err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue