mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2024-11-23 06:18:59 +00:00
Fix error page (#144)
Co-authored-by: crapStone <crapstone01@gmail.com> Reviewed-on: https://codeberg.org/Codeberg/pages-server/pulls/144 Reviewed-by: 6543 <6543@obermui.de> Co-authored-by: crapStone <crapstone@noreply.codeberg.org> Co-committed-by: crapStone <crapstone@noreply.codeberg.org>
This commit is contained in:
parent
5e72753e91
commit
dcf03fc078
@ -1,6 +1,7 @@
|
||||
package html
|
||||
|
||||
import (
|
||||
"html/template"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
@ -39,7 +40,8 @@ func errorMessage(statusCode int) string {
|
||||
|
||||
// TODO: use template engine
|
||||
func errorBody(statusCode int) string {
|
||||
return strings.ReplaceAll(NotFoundPage,
|
||||
"%status%",
|
||||
strconv.Itoa(statusCode)+" "+errorMessage(statusCode))
|
||||
return template.HTMLEscapeString(
|
||||
strings.ReplaceAll(NotFoundPage,
|
||||
"%status%",
|
||||
strconv.Itoa(statusCode)+" "+errorMessage(statusCode)))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user