How to bloody well make sure you read the entire goddamn InputStream from an HTTPExchange.requestBody
let stream = htex.getRequestBody(),
buf = new java.lang.StringBuilder(),
read = -1,
bytes;
do {
bytes = java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, stream.available());
read = stream.read(bytes);
buf.append(new java.lang.String(bytes));
} while(read != -1);
stream.close();
Took me hours to figure out it wasn’t reading the whole thing in the first place.