Skip to content

Commit

Permalink
Use wakatime.com instead of api.wakatime.com
Browse files Browse the repository at this point in the history
The former endpoint was incorrectly returning HTML instead of JSON and
wasn't working over HTTPS.

Relevant issue: mujx#43
  • Loading branch information
Konstantinos Sideris committed Aug 31, 2021
1 parent a44dabd commit 81fe8ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Haka/Handlers/Import.hs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ queueName :: Text
queueName = "_import_requests_queue_channel"

wakatimeApi :: Text
wakatimeApi = "api.wakatime.com"
wakatimeApi = "wakatime.com"

data ImportHeartbeatPayload = ImportHeartbeatPayload
{ wMachine_name_id :: Maybe Text,
Expand Down Expand Up @@ -147,7 +147,7 @@ logExceptions logenv e = do

case fromException e :: Maybe R.HttpException of
Just (R.VanillaHttpException (HttpClient.HttpExceptionRequest _ c)) ->
logError ("http call to api.wakatime.com failed: " <> show c)
logError ("http call to " <> show wakatimeApi <> " failed: " <> show c)
Just (R.VanillaHttpException (HttpClient.InvalidUrlException url reason)) ->
logError ("http call was made with invalid URL " <> show url <> ": " <> show reason)
Just (R.JsonHttpException s) ->
Expand Down

0 comments on commit 81fe8ed

Please sign in to comment.