Fixed errors & warnings; compiling with Nim v0.15.2.
h3rald h3rald@h3rald.com
Fri, 02 Dec 2016 21:48:06 +0100
7 files changed,
10 insertions(+),
10 deletions(-)
M
lib/api_v1.nim
→
lib/api_v1.nim
@@ -396,7 +396,7 @@ let path = LS.directory / id
var reqMethod = req.reqMethod if req.headers.hasKey("X-HTTP-Method-Override"): reqMethod = req.headers["X-HTTP-Method-Override"] - case reqMethod.toUpper: + case reqMethod.toUpperAscii: of "OPTIONS": return validate(req, LS, "dir", id, options) of "GET":@@ -421,7 +421,7 @@ proc route*(req: Request, LS: LiteStore, resource = "docs", id = ""): Response =
var reqMethod = req.reqMethod if req.headers.hasKey("X-HTTP-Method-Override"): reqMethod = req.headers["X-HTTP-Method-Override"] - case reqMethod.toUpper: + case reqMethod.toUpperAscii: of "POST": if LS.readonly: return resError(Http405, "Method not allowed: $1" % req.reqMethod)
M
lib/api_v2.nim
→
lib/api_v2.nim
@@ -435,7 +435,7 @@ let path = LS.directory / id
var reqMethod = req.reqMethod if req.headers.hasKey("X-HTTP-Method-Override"): reqMethod = req.headers["X-HTTP-Method-Override"] - case reqMethod.toUpper: + case reqMethod.toUpperAscii: of "OPTIONS": return validate(req, LS, "dir", id, options) of "GET":@@ -460,7 +460,7 @@ proc route*(req: Request, LS: LiteStore, resource = "docs", id = ""): Response =
var reqMethod = req.reqMethod if req.headers.hasKey("X-HTTP-Method-Override"): reqMethod = req.headers["X-HTTP-Method-Override"] - case reqMethod.toUpper: + case reqMethod.toUpperAscii: of "POST": if LS.readonly: return resError(Http405, "Method not allowed: $1" % req.reqMethod)
M
lib/cli.nim
→
lib/cli.nim
@@ -8,7 +8,7 @@ config,
types, utils -const favicon = "admin/favicon.ico".slurp +const favicon = "../admin/favicon.ico".slurp var operation = opRun
M
lib/config.nim
→
lib/config.nim
@@ -4,7 +4,7 @@ streams,
strutils const - cfgfile = "litestore.nimble".slurp + cfgfile = "../litestore.nimble".slurp var file* = "data.db"@@ -16,7 +16,7 @@ f = newStringStream(cfgfile)
if f != nil: var p: CfgParser - open(p, f, "litestore.nimble") + open(p, f, "../litestore.nimble") while true: var e = next(p) case e.kind
M
lib/contenttypes.nim
→
lib/contenttypes.nim
@@ -3,7 +3,7 @@
proc loadContentTypes(): StringTableRef = result = newStringTable(modeCaseInsensitive) - const raw_json = "lib/contenttypes.json".slurp + const raw_json = "../lib/contenttypes.json".slurp let json = raw_json.parseJson for item in json.items: for pair in item.pairs:
M
lib/server.nim
→
lib/server.nim
@@ -59,7 +59,7 @@ return resError(Http400, "Bad request - Invalid resource: $1" % info.resource)
proc process(req: Request, LS: LiteStore): Response {.gcsafe.}= var matches = @["", "", ""] - template route(req, peg: expr, op: stmt): stmt {.immediate.}= + template route(req: Request, peg: Peg, op: untyped): untyped = if req.url.path.find(peg, matches) != -1: op try:
M
lib/x_asynchttpserver.nim
→
lib/x_asynchttpserver.nim
@@ -197,7 +197,7 @@ var nMethod = reqMethod.normalize
if nMethod == "post" or nMethod == "put" or nMethod == "patch": # Check for Expect header if request.headers.hasKey("Expect"): - if request.headers["Expect"].toLower == "100-continue": + if request.headers["Expect"].toLowerAscii == "100-continue": await client.sendStatus("100 Continue") else: await client.sendStatus("417 Expectation Failed")