fix: also check if correct url parameters have been used
This commit is contained in:
parent
1247847e9a
commit
c4e4ea0f52
@ -10,7 +10,7 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// https://dd.phga.de/dd?usr=<username>&pw=<passwd>
|
||||
// https://dd.phga.de/dd?usr=<username>&pwd=<passwd>
|
||||
func main() {
|
||||
// cheap routing
|
||||
http.HandleFunc("/dd", handleDynamicUpdate)
|
||||
@ -30,7 +30,7 @@ func handleDynamicUpdate(w http.ResponseWriter, r *http.Request) {
|
||||
ip = strings.Split(r.RemoteAddr, ":")[0]
|
||||
}
|
||||
|
||||
if len(up) != 2 {
|
||||
if len(up) != 2 || len(up["usr"]) != 1 || len(up["pwd"]) != 1 {
|
||||
log.Println("Attempted update for:", ip)
|
||||
log.Println("Not enough arguments provided:", up)
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user