diff --git a/pit.nimble b/pit.nimble index ac81e99..90a692e 100644 --- a/pit.nimble +++ b/pit.nimble @@ -11,5 +11,5 @@ bin = @["pit", "pit_api"] # Dependencies -requires @[ "nim >= 0.19.0", "cliutils 0.6.0", "docopt 0.6.8", "jester 0.4.1", +requires @[ "nim >= 0.19.0", "cliutils 0.6.1", "docopt 0.6.8", "jester 0.4.1", "langutils >= 0.4.0", "timeutils 0.3.0", "uuids 0.1.10" ] diff --git a/src/pit_api.nim b/src/pit_api.nim index a208333..fee0a8b 100644 --- a/src/pit_api.nim +++ b/src/pit_api.nim @@ -56,7 +56,7 @@ template checkAuth(cfg: PitApiCfg) = stderr.writeLine "Auth failed: " & getCurrentExceptionMsg() halt( Http401, - headers & @{"Content-Type": TXT}, + @{"Content-Type": TXT}, getCurrentExceptionMsg()) proc start*(cfg: PitApiCfg) = @@ -73,7 +73,7 @@ proc start*(cfg: PitApiCfg) = resp("pong", TXT) get "/issues": - checkAuth(cfg); if not authed: return true + checkAuth(cfg) var args = queryParamsToCliArgs(request.params) args = @["list"] & args @@ -84,10 +84,10 @@ proc start*(cfg: PitApiCfg) = else: resp(stripAnsi(execResult[0]), TXT) post "/issues": - checkAuth(cfg); if not authed: return true + checkAuth(cfg) get "/issue/@issueId": - checkAuth(cfg); if not authed: return true + checkAuth(cfg) var args = queryParamsToCliArgs(request.params) args = @["list", @"issueId"] & args