| } | } | ||||
| } | } | ||||
| //Catch for all | //Catch for all | ||||
| apiV1Error(w, r) | |||||
| apiV1DumpRequest(w, r) | |||||
| } | } | ||||
| func apiV1Login(w http.ResponseWriter, r *http.Request) { | func apiV1Login(w http.ResponseWriter, r *http.Request) { | ||||
| if e == nil { | if e == nil { | ||||
| fmt.Fprint(w, string(b)) | fmt.Fprint(w, string(b)) | ||||
| } else { | } else { | ||||
| apiV1Error(w, nil) | |||||
| apiV1DumpRequest(w, nil) | |||||
| } | } | ||||
| } | } | ||||
| func apiV1Error(w http.ResponseWriter, r *http.Request) { | |||||
| func apiV1DumpRequest(w http.ResponseWriter, r *http.Request) { | |||||
| dump := logRequestDebug(httputil.DumpRequest(r, true)) | dump := logRequestDebug(httputil.DumpRequest(r, true)) | ||||
| dump = strings.TrimSpace(dump) | |||||
| msg := fmt.Sprintf("Unhandled Protocol = %s path= %s", r.Method, r.URL.Path) | msg := fmt.Sprintf("Unhandled Protocol = %s path= %s", r.Method, r.URL.Path) | ||||
| dumpLines := strings.Split(dump, "\r\n") | dumpLines := strings.Split(dump, "\r\n") | ||||
| ar := apiV1ResponseBlank() | ar := apiV1ResponseBlank() |