Fixed problems with setOrigin.
h3rald h3rald@h3rald.com
Sat, 16 Feb 2019 20:52:16 +0000
3 files changed,
5 insertions(+),
1 deletions(-)
M
src/litestorepkg/lib/api_v4.nim
→
src/litestorepkg/lib/api_v4.nim
@@ -478,6 +478,7 @@ if not folder.isFolder:
return resError(Http400, "Invalid folder specified when creating document: $1" % folder) try: var doc = LS.store.createDocument(folder, body, ct) + echo doc if doc != "": result.headers = ctJsonHeader() setOrigin(LS, req, result.headers)@@ -486,6 +487,7 @@ result.code = Http201
else: result = resError(Http500, "Unable to create document.") except: + eWarn() result = resError(Http500, "Unable to create document.") proc putDocument*(LS: LiteStore, id: string, body: string, ct: string, req: LSRequest): LSResponse =
M
src/litestorepkg/lib/core.nim
→
src/litestorepkg/lib/core.nim
@@ -99,12 +99,14 @@ if LS_TRANSACTION:
LOG.debug("Committing transaction") LS_TRANSACTION = false store.db.exec("COMMIT".sql) + LOG.debug("Committed.") proc rollback(store: Datastore) = if LS_TRANSACTION: LOG.debug("Rolling back transaction") LS_TRANSACTION = false store.db.exec("ROLLBACK".sql) + LOG.debug("Rolled back.") # Manage Tags
M
src/litestorepkg/lib/utils.nim
→
src/litestorepkg/lib/utils.nim
@@ -27,7 +27,7 @@ elif req.headers.hasKey("origin"):
let parts = req.headers["origin"].split("://") protocol = parts[0] let server = parts[1].split(":") - if (parts.len >= 2): + if (server.len >= 2): host = server[0] port = server[1] else: