Fix for Nim 1.6.2

This commit is contained in:
Jonathan Bernard 2021-12-20 17:42:55 -06:00
parent 7c7695b891
commit aff927b4f4
3 changed files with 5 additions and 5 deletions

@ -1,7 +1,7 @@
## Personal Time Keeping API Interface ## Personal Time Keeping API Interface
## =================================== ## ===================================
import asyncdispatch, base64, bcrypt, cliutils, docopt, jester, json, logging, import asyncdispatch, base64, bcrypt, cliutils, docopt, httpcore, jester, json, logging,
sequtils, strutils, os, tables, times, uuids sequtils, strutils, os, tables, times, uuids
import nre except toSeq import nre except toSeq
@ -61,10 +61,10 @@ template checkAuth(cfg: PtkApiCfg) =
var user {.inject.}: PtkUser = PtkUser() var user {.inject.}: PtkUser = PtkUser()
try: try:
if not request.headers.hasKey("Authorization"): if not headers(request).hasKey("Authorization"):
raiseEx "No auth token." raiseEx "No auth token."
let headerVal = request.headers["Authorization"] let headerVal = headers(request)["Authorization"]
if not headerVal.startsWith("Basic "): if not headerVal.startsWith("Basic "):
raiseEx "Invalid Authorization type (only 'Basic' is supported)." raiseEx "Invalid Authorization type (only 'Basic' is supported)."

@ -1 +1 @@
const PTK_VERSION* = "1.0.10" const PTK_VERSION* = "1.0.11"

@ -1,6 +1,6 @@
# Package # Package
version = "1.0.10" version = "1.0.11"
author = "Jonathan Bernard" author = "Jonathan Bernard"
description = "Personal Time Keeper" description = "Personal Time Keeper"
license = "MIT" license = "MIT"