Closed h3nrique closed 2 years ago
Not accept Content-Type with charset
A Curl command to simulate
curl -v -H "Content-Type: application/json; charset=UTF-8" -X POST -d '{ "app":{ "name":"GitHub API", "url":"http://developer.github.com/v3/oauth/" }}' http://localhost:8080/jenkins/generic-webhook-trigger/invoke?token=sometoken
Jenkins output log
jenkins_1 | 2021-12-22 21:39:15.876+0000 [id=480] WARNING h.i.i.InstallUncaughtExceptionHandler#handleException: Caught unhandled exception with ID a9d6fff4-bc76-47ca-af0f-1734ee61581d jenkins_1 | java.lang.RuntimeException: Unsupported content type: application/json; charset=UTF-8 jenkins_1 | at org.jenkinsci.plugins.gwt.GenericWebHookRequestReceiver.getPostContentAsJson(GenericWebHookRequestReceiver.java:104) jenkins_1 | at org.jenkinsci.plugins.gwt.GenericWebHookRequestReceiver.doInvoke(GenericWebHookRequestReceiver.java:69)
I used docker-compose to install latest version of plugin and simulate.
version: "3" services: jenkins: image: jenkins/jenkins:lts-jdk11 environment: TZ: America/Fortaleza ports: - 8080:8080 - 50000:50000 volumes: - /var/run/docker.sock:/var/run/docker.sock - /opt/docker-data/jenkins:/var/jenkins_home
I identified this problem when configure Azure Web Hooks, by default it's including "; charset=UTF-8" and it's not possible remove or change.
Thanks for reporting. Released a fix now in 1.79. Open issue again if not working.
Work like a charm. Thanks beast!!
Not accept Content-Type with charset
A Curl command to simulate
Jenkins output log
I used docker-compose to install latest version of plugin and simulate.
I identified this problem when configure Azure Web Hooks, by default it's including "; charset=UTF-8" and it's not possible remove or change.![image](https://user-images.githubusercontent.com/813562/147159263-b64da045-b1ce-4770-9a42-ffcf3f1389da.png)