Skip to content

Commit

Permalink
JSONのキー名にハイフンを含めない #158
Browse files Browse the repository at this point in the history
  • Loading branch information
jiro4989 committed Apr 7, 2020
1 parent 09e8fa1 commit a666d03
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 a666d03

Please sign in to comment.