File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/main/kotlin/io/github/darefox/hltbproxy/hltb Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -93,12 +93,13 @@ object HLTB {
9393 log.info(" Updating key..." )
9494 keyMutex.withLock { // keyMutex needed for API calls to wait new key
9595 val url = " https://howlongtobeat.com"
96- val response = client(Request (GET , url).hltbDefaultHeaders(url, false ))
96+ val request = Request (GET , url).hltbDefaultHeaders(url, false )
97+ val response = client(request)
9798
9899 val bodyString = response.bodyString()
99- if (response.status != Status . OK ) {
100+ if (! response.status.successful ) {
100101 log.error { " Response is not ok, body: ${response.bodyString()} " }
101- error(" Response is not 199 from HLTB server, can't get search key " )
102+ error(" Can't get search key, HLTB server returned ${response.status.code} " )
102103 }
103104
104105 val html = Jsoup .parse(bodyString)
You can’t perform that action at this time.
0 commit comments