Skip to content

Commit

Permalink
Fix js tests; don't set body when sending HEAD request
Browse files Browse the repository at this point in the history
  • Loading branch information
anti-social committed Oct 7, 2021
1 parent fbb143c commit 7dbeb1c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ allprojects {
tasks.findByName("nativeTest")?.run {
outputs.upToDateWhen { false }
}
tasks.findByName("jsNodeTest")?.run {
outputs.upToDateWhen { false }
}
tasks.findByName("jvmTest")?.run {
outputs.upToDateWhen { false }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,12 @@ class ElasticsearchKtorTransport(
} else {
ContentType.Application.Json
}
this.body = ByteArrayContent(
requestEncoder.toByteArray(),
contentType
)
if (ktorHttpMethod != HttpMethod.Head) {
this.body = ByteArrayContent(
requestEncoder.toByteArray(),
contentType
)
}
}
}
return processResponse(response)
Expand Down

0 comments on commit 7dbeb1c

Please sign in to comment.