// Suppress returning unsuccessful result. Maybe
// another request will find it.
// TODO collect and return error responses.
- *s.errors = append(*s.errors, fmt.Sprintf("Response from %q: %v", s.remoteID, resp.Status))
+ *s.errors = append(*s.errors, fmt.Sprintf("Response to %q from %q: %v", httpserver.GetRequestID(resp.Header), s.remoteID, resp.Status))
if resp.StatusCode != 404 {
// Got a non-404 error response, convert into BadGateway
*s.statusCode = http.StatusBadGateway
defer req.Body.Close()
var request map[string]interface{}
err := json.NewDecoder(req.Body).Decode(&request)
+ if err != nil {
+ return false
+ }
+
+ crString, ok := request["container_request"].(string)
+ if ok {
+ var crJson map[string]interface{}
+ err := json.Unmarshal([]byte(crString), &crJson)
+ if err != nil {
+ return false
+ }
+
+ request["container_request"] = crJson
+ }
containerRequest, ok := request["container_request"].(map[string]interface{})
if !ok {
- log.Printf("wah wah")
return false
}