Skip to content

Commit

Permalink
Do not set content length to zero (#11417)
Browse files Browse the repository at this point in the history
Fixes: #11342
  • Loading branch information
krmahadevan authored Dec 14, 2022
1 parent 87b4de8 commit fad29a3
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public ContainerLogs apply(ContainerId id) {

HttpResponse res = client.execute(
new HttpRequest(GET, requestUrl)
.addHeader("Content-Length", "0")
.addHeader("Content-Type", "text/plain"));
if (res.getStatus() != HTTP_OK) {
LOG.warning("Unable to inspect container " + id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public ContainerInfo apply(ContainerId id) {

HttpResponse res = client.execute(
new HttpRequest(GET, String.format("/v%s/containers/%s/json", DOCKER_API_VERSION, id))
.addHeader("Content-Length", "0")
.addHeader("Content-Type", "text/plain"));
if (res.getStatus() != HTTP_OK) {
LOG.warning("Unable to inspect container " + id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public boolean apply(ContainerId id) {

HttpResponse res = client.execute(
new HttpRequest(GET, String.format("/v%s/containers/%s/json", DOCKER_API_VERSION, id))
.addHeader("Content-Length", "0")
.addHeader("Content-Type", "text/plain"));

return res.isSuccessful();
Expand Down
1 change: 0 additions & 1 deletion java/src/org/openqa/selenium/docker/v1_41/ListImages.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public Set<Image> apply(Reference reference) {

// https://docs.docker.com/engine/api/v1.41/#operation/ImageList
HttpRequest req = new HttpRequest(GET, String.format("/v%s/images/json", DOCKER_API_VERSION))
.addHeader("Content-Length", "0")
.addHeader("Content-Type", JSON_UTF_8)
.addQueryParameter("filters", JSON.toJson(filters));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public void apply(ContainerId id) {
throwIfNecessary(
client.execute(
new HttpRequest(POST, String.format("/v%s/containers/%s/start", DOCKER_API_VERSION, id))
.addHeader("Content-Length", "0")
.addHeader("Content-Type", "text/plain")),
"Unable to start container: %s",
id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public void apply(ContainerId id, Duration timeout) {

String requestUrl = String.format("/v%s/containers/%s/stop", DOCKER_API_VERSION, id);
HttpRequest request = new HttpRequest(POST, requestUrl)
.addHeader("Content-Length", "0")
.addHeader("Content-Type", "text/plain")
.addQueryParameter("t", seconds);

Expand Down

0 comments on commit fad29a3

Please sign in to comment.