We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 26dd4de commit ccf6278Copy full SHA for ccf6278
java/src/org/openqa/selenium/remote/http/jdk/JdkHttpMessages.java
@@ -115,7 +115,12 @@ private BodyPublisher notChunkingBodyPublisher(HttpRequest req) {
115
116
if (length == null) {
117
// read the data into a byte array to know the length
118
- return BodyPublishers.ofByteArray(Contents.bytes(req.getContent()));
+ byte[] bytes = Contents.bytes(req.getContent());
119
+ if (bytes.length == 0) {
120
+ //Looks like we were given a request with no payload.
121
+ return BodyPublishers.noBody();
122
+ }
123
+ return BodyPublishers.ofByteArray(bytes);
124
}
125
126
// we know the length of the request and use it
0 commit comments