From 017ff70120208964eae8e769d4ddca696bbe2406 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 16 Apr 2011 18:19:04 -0400 Subject: [PATCH] Use |map[string] interface{}| to allow returning int error codes --- src/server.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/server.go b/src/server.go index 72ade34..c1f698d 100644 --- a/src/server.go +++ b/src/server.go @@ -67,8 +67,9 @@ func serviceHandler(response http.ResponseWriter, request *http.Request) { if err != nil { errorResponse(response, err.String()) } else { - data := map[string] string { + data := map[string] interface{} { "path" : target, + "error" : 0, } okResponse(response, data) } @@ -142,8 +143,8 @@ func performProxy(url *http.URL, response http.ResponseWriter, origRequest *http func errorResponse(response http.ResponseWriter, message string) { message = strings.Replace(message, gConfig.JailRoot, "/", -1) - data := map[string] string { - "error" : "-1", + data := map[string] interface{} { + "error" : -1, "message" : message, } json_data, err := json.Marshal(data) -- 2.43.5