Explorar el Código

Accept name=name arg instead of only board=name

master
NGnius (Graham) hace 3 años
padre
commit
0370c90ba9
Se han modificado 1 ficheros con 8 adiciones y 2 borrados
  1. +8
    -2
      handlers.go

+ 8
- 2
handlers.go Ver fichero

@@ -33,11 +33,17 @@ func boardHandler(w http.ResponseWriter, r *http.Request) {
}
args := r.URL.Query()
// check args pre-conditions
if !checkArgExists(args, "board", w) {
if !(checkArgExists(args, "board", w) || checkArgExists(args, "name", w)) {
errorResponse(400, "Missing required 'board' URL parameter", w, r)
return
}
board := args.Get("board")
board := ""
if checkArgExists(args, "name", w) {
board = args.Get("name")
}
if checkArgExists(args, "board", w) {
board = args.Get("board")
}
if !checkArgExists(args, "count", w) || !checkArgInt(args, "count", w, 0) {
//w.WriteHeader(400)
errorResponse(400, "Missing required 'count' integer URL parameter", w, r)