refactor-test #15
|
@ -18,14 +18,14 @@ func (server Server) ServeHTTP(res http.ResponseWriter, req *http.Request) {
|
||||||
// 1. find a matching service in the config
|
// 1. find a matching service in the config
|
||||||
service := server.conf.Find(req)
|
service := server.conf.Find(req)
|
||||||
if service == nil {
|
if service == nil {
|
||||||
errorHandler(api.ErrorUnknownService)
|
errorHandler(api.ErrorUnknownService).ServeHTTP(res, req)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. extract request data
|
// 2. extract request data
|
||||||
dataset, err := extractRequestData(service, *req)
|
dataset, err := extractRequestData(service, *req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errorHandler(api.ErrorMissingParam)
|
errorHandler(api.ErrorMissingParam).ServeHTTP(res, req)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ func (server Server) ServeHTTP(res http.ResponseWriter, req *http.Request) {
|
||||||
|
|
||||||
// 4. fail if found no handler
|
// 4. fail if found no handler
|
||||||
if handler == nil {
|
if handler == nil {
|
||||||
errorHandler(api.ErrorUncallableService)
|
errorHandler(api.ErrorUncallableService).ServeHTTP(res, req)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue