Skip to content

Commit

Permalink
Merge pull request #159 from jiro4989/hotfix/#158-x-forwarded-for-jso…
Browse files Browse the repository at this point in the history
…n-key

JSONのキー名にハイフンを含めない #158
  • Loading branch information
jiro4989 authored Apr 7, 2020
2 parents 09e8fa1 + a666d03 commit 2307882
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions websh_server/src/websh_server.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 2307882

Please sign in to comment.