empty query means default values

This commit is contained in:
Nan Deng 2014-07-07 22:10:25 -07:00
parent 4d0b365d43
commit 38c5f0e29f

View File

@ -19,6 +19,7 @@ package api
import ( import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"io"
"log" "log"
"net/http" "net/http"
"strings" "strings"
@ -72,8 +73,8 @@ func HandleRequest(m manager.Manager, w http.ResponseWriter, r *http.Request) er
var query info.ContainerInfoQuery var query info.ContainerInfoQuery
decoder := json.NewDecoder(r.Body) decoder := json.NewDecoder(r.Body)
err := decoder.Decode(&query) err := decoder.Decode(&query)
if err != nil { if err != nil && err != io.EOF {
fmt.Fprintf(w, "unable to decode the json value: %v", err) fmt.Fprintf(w, "unable to decode the json value: ", err)
return err return err
} }
// Get the container. // Get the container.