mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2024-11-18 10:29:43 +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 changed files with 5 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
||||||
package html
|
package html
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"html/template"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -39,7 +40,8 @@ func errorMessage(statusCode int) string {
|
||||||
|
|
||||||
// TODO: use template engine
|
// TODO: use template engine
|
||||||
func errorBody(statusCode int) string {
|
func errorBody(statusCode int) string {
|
||||||
return strings.ReplaceAll(NotFoundPage,
|
return template.HTMLEscapeString(
|
||||||
|
strings.ReplaceAll(NotFoundPage,
|
||||||
"%status%",
|
"%status%",
|
||||||
strconv.Itoa(statusCode)+" "+errorMessage(statusCode))
|
strconv.Itoa(statusCode)+" "+errorMessage(statusCode)))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue