Skip to content

Commit

Permalink
Capitalise Bearer in Authorization scheme
Browse files Browse the repository at this point in the history
Also switch to github-token as the file name (in anticipation of a
cakeml-token).
  • Loading branch information
xrchz committed Nov 14, 2017
1 parent 798e114 commit 34491e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
token
*-token
poll
api
worker
Expand Down
6 changes: 3 additions & 3 deletions serverLib.sml
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,10 @@ in
end

structure GitHub = struct
val token = until_space (file_to_string "token")
val token = until_space (file_to_string "github-token")
val graphql_endpoint = "https://api.github.com/graphql"
fun graphql_curl_cmd query = (curl_path,["--silent","--show-error",
"--header",String.concat["Authorization: bearer ",token],
"--header",String.concat["Authorization: Bearer ",token],
"--request","POST",
"--data",String.concat["{\"query\" : \"",query,"\"}"],
graphql_endpoint])
Expand All @@ -298,7 +298,7 @@ structure GitHub = struct
val rest_endpoint = "https://api.github.com"
val rest_version = "application/vnd.github.v3+json"
fun rest_curl_cmd endpoint data = (curl_path,["--silent","--show-error",
"--header",String.concat["Authorization: bearer ",token],
"--header",String.concat["Authorization: Bearer ",token],
"--header",String.concat["Accept: ",rest_version],
"--write-out", "%{http_code}",
"--output", "/dev/null",
Expand Down

0 comments on commit 34491e9

Please sign in to comment.