Merge pull request #63 from tomidery/fix-minor-bugs
Fabio Cevasco h3rald@h3rald.com
Tue, 06 Apr 2021 16:25:06 +0200
3 files changed,
6 insertions(+),
3 deletions(-)
M
src/litestorepkg/lib/api_v7.nim
→
src/litestorepkg/lib/api_v7.nim
@@ -707,7 +707,9 @@ else:
return resError(Http400, "Bad request: patch operation #$1 is malformed." % $c) c.inc if apply: - if origData.len > 0 and origData != data: + # when document is not JSON the origData is not defined + # the extra check allows editing tags for non-JSON documents + if origData != nil and origData.len > 0 and origData != data: try: var doc = LS.store.updateDocument(id, data.pretty, "application/json") if doc == "":
M
src/litestorepkg/lib/server.nim
→
src/litestorepkg/lib/server.nim
@@ -248,12 +248,12 @@ return result
req.route PEG_DEFAULT_URL: info.version = "v7" info.resource = matches[0] - info.id = matches[1] + info.id = matches[1].decodeUrl return req.processApiUrl(LS, info) req.route PEG_URL: info.version = matches[0] info.resource = matches[1] - info.id = matches[2] + info.id = matches[2].decodeUrl return req.processApiUrl(LS, info) raise newException(EInvalidRequest, req.getReqInfo()) except EInvalidRequest: