Files
godoxy/internal/auth/block_page.go
yusing 167d54ae57 chore(embed): adopt *.min.* for embedded HTML/JS
Point go:embed at block_page.min.html, loading_page.min.html,
loading.min.js, and captcha.min.html.  Update the minified-files
gitignore glob from **/*-min.* to **/*.min.*.
2026-04-23 17:23:39 +08:00

24 lines
554 B
Go

package auth
import (
"html/template"
"net/http"
_ "embed"
)
//go:embed block_page.min.html
var blockPageHTML string
var blockPageTemplate = template.Must(template.New("block_page").Parse(blockPageHTML))
func WriteBlockPage(w http.ResponseWriter, status int, errorMessage, actionText, actionURL string) {
w.Header().Set("Content-Type", "text/html; charset=utf-8")
blockPageTemplate.Execute(w, map[string]string{
"StatusText": http.StatusText(status),
"Error": errorMessage,
"ActionURL": actionURL,
"ActionText": actionText,
})
}