Skip to content

Commit 4f9c845

Browse files
authored
Merge pull request #29 from JuliaComputing/sp/json-serialization
fix: use json serialization for robustness
2 parents 9522699 + be4edef commit 4f9c845

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/PkgAuthentication.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,10 @@ function step(state::ClaimToken)::Union{ClaimToken, HasNewToken, Failure}
339339
sleep(state.poll_interval)
340340

341341
output = IOBuffer()
342-
data = """{ "challenge": "$(state.challenge)", "response": "$(state.response)" }"""
342+
data = JSON.json(Dict(
343+
"challenge" => state.challenge,
344+
"response" => state.response,
345+
))
343346
response = Downloads.request(
344347
string(state.server, "/claimtoken"),
345348
method = "POST",

0 commit comments

Comments
 (0)