This commit is contained in:
6543 2022-11-12 19:57:37 +01:00
parent 162ac30f5c
commit 66c56dcf82
No known key found for this signature in database
GPG key ID: C99B82E40B027BAE
5 changed files with 283 additions and 200 deletions

View file

@ -3,6 +3,8 @@ package context
import (
stdContext "context"
"net/http"
"codeberg.org/codeberg/pages/server/utils"
)
type Context struct {
@ -56,3 +58,7 @@ func (c *Context) Path() string {
func (c *Context) Host() string {
return c.Req.URL.Host
}
func (c *Context) TrimHostPort() string {
return utils.TrimHostPort(c.Req.Host)
}