-
Notifications
You must be signed in to change notification settings - Fork 110
Description
I developed a plugin which receives http body as notifications from gitlab and bitbucket. This plugin is working as expected in previous versions (2020 approximately). Today I installed it on latest version 2.293 and when I send a classic http post with json body using my postman I detected that is empty or null.
Url parameters and headers are detected, but body is null.
Jenkins plugin template use stapler instead native httpservletrequest.
And this is how I extract the body:
https://github.com/software-architect-tools/easy-webhook-plugin/blob/058fadcc95519d2194340628a026203b930bad05/src/main/java/org/jrichardsz/jenkins/plugins/easywebhook/WebhookExecutor.java#L28
Thinking that something changed, I updated my plugin with latest jenkins libraries using bitbucket plugin pom.xml as example. This plugin uses the same procedure to get the body. But the error is the same.
Also I tried with:
- request.getReader().lines().collect(Collectors.joining(System.lineSeparator()));
- IOUtils.toString(request.getReader());
I will continue my tests.
Thanks