Allow singe dots in page path, fix #1
This commit is contained in:
parent
97e4cbb158
commit
cc536a36b3
1 changed files with 1 additions and 1 deletions
2
main.go
2
main.go
|
@ -30,7 +30,7 @@ func handleApplication(w http.ResponseWriter, req *http.Request) {
|
||||||
var err error
|
var err error
|
||||||
entryName := strings.Trim(req.URL.Path, "/")
|
entryName := strings.Trim(req.URL.Path, "/")
|
||||||
if entryName != "" {
|
if entryName != "" {
|
||||||
if strings.Contains(entryName, "/") || strings.Contains(entryName, ".") {
|
if strings.Contains(entryName, "/") || strings.Contains(entryName, "..") {
|
||||||
// path traversal
|
// path traversal
|
||||||
logger.Println("Possible path traversal attempt from", req.RemoteAddr, "to", entryName)
|
logger.Println("Possible path traversal attempt from", req.RemoteAddr, "to", entryName)
|
||||||
w.WriteHeader(http.StatusForbidden)
|
w.WriteHeader(http.StatusForbidden)
|
||||||
|
|
Reference in a new issue