From a666d032fb66805b9f9b01d09c202b919c07ee3b Mon Sep 17 00:00:00 2001 From: jiro4989 Date: Tue, 7 Apr 2020 21:24:58 +0900 Subject: [PATCH] =?UTF-8?q?JSON=E3=81=AE=E3=82=AD=E3=83=BC=E5=90=8D?= =?UTF-8?q?=E3=81=AB=E3=83=8F=E3=82=A4=E3=83=95=E3=83=B3=E3=82=92=E5=90=AB?= =?UTF-8?q?=E3=82=81=E3=81=AA=E3=81=84=20#158?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- websh_server/src/websh_server.nim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/websh_server/src/websh_server.nim b/websh_server/src/websh_server.nim index 4d20e8c..018f3b9 100644 --- a/websh_server/src/websh_server.nim +++ b/websh_server/src/websh_server.nim @@ -107,11 +107,12 @@ proc createMediaFiles(dir: string, medias: seq[string]) = router myrouter: post "/shellgei": const - xForHeader = "X-Forwarded-for" + # #158 JSONのキーにハイフンを含めるべきでないのでlowerCamelCaseにする + xForHeader = "xForwardedFor" let now = now() uuid = $genUUID() - xFor = request.headers().getOrDefault(xForHeader) + xFor = request.headers().getOrDefault("X-Forwarded-for") try: var respJson = request.body().parseJson().to(ReqShellgeiJSON)