mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-04-19 11:36:57 +00:00
Security Fix: clean paths correctly to avoid circumvention of BlacklistedPaths
This commit is contained in:
parent
d720d25e42
commit
56d3e291c4
3 changed files with 72 additions and 4 deletions
|
@ -48,11 +48,9 @@ func (c *Context) Redirect(uri string, statusCode int) {
|
|||
http.Redirect(c.RespWriter, c.Req, uri, statusCode)
|
||||
}
|
||||
|
||||
// Path returns requested path.
|
||||
//
|
||||
// The returned bytes are valid until your request handler returns.
|
||||
// Path returns the cleaned requested path.
|
||||
func (c *Context) Path() string {
|
||||
return c.Req.URL.Path
|
||||
return utils.CleanPath(c.Req.URL.Path)
|
||||
}
|
||||
|
||||
func (c *Context) Host() string {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue