-
Bug
-
Resolution: Fixed
-
Critical
-
None
There is a bug in the loop that reads the incoming data with a 1024 byte buffer. The full content of the buffer is always appended to the output string, even when fewer than 1024 characters were read. As a result, when the incoming data is longer than 1024 bytes, some extra bytes are appended at the end of the output from the last full buffer read operation. This doesn't impact payloads smaller than 1024 bytes as the buffer is allegedly initialised with 0.
Here's a small fix for this bug, by setting the limit of the buffer to the number of bytes read before appending its content to the output:
https://github.com/jenkinsci/webhook-step-plugin/pull/6