Skip to content

Commit 95b5b10

Browse files
alacosteshadycuz
authored andcommitted
Fix HTTP request crash when the response does not contain a Content-Type header.
Fixes: #305
1 parent 06eff83 commit 95b5b10

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/org/dsty/http/Requests.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class Requests implements Serializable {
153153

154154
Response response = handleRequest(connection)
155155

156-
if (response.headers?.'Content-Type'.contains('application/json')) {
156+
if (response.headers?.'Content-Type'?.contains('application/json') == true) {
157157
JsonSlurperClassic slurper = new JsonSlurperClassic()
158158
response.json = slurper.parseText(response.body)
159159
}

0 commit comments

Comments
 (0)