Skip to content

Commit

Permalink
Fix HTTP request crash when the response does not contain a `Content-…
Browse files Browse the repository at this point in the history
…Type` header.

Fixes: #305
  • Loading branch information
alacoste authored and shadycuz committed Mar 17, 2023
1 parent 06eff83 commit 95b5b10
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/org/dsty/http/Requests.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class Requests implements Serializable {

Response response = handleRequest(connection)

if (response.headers?.'Content-Type'.contains('application/json')) {
if (response.headers?.'Content-Type'?.contains('application/json') == true) {
JsonSlurperClassic slurper = new JsonSlurperClassic()
response.json = slurper.parseText(response.body)
}
Expand Down

0 comments on commit 95b5b10

Please sign in to comment.