Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not accept Content-Type with charset #226

Closed
h3nrique opened this issue Dec 22, 2021 · 2 comments
Closed

Not accept Content-Type with charset #226

h3nrique opened this issue Dec 22, 2021 · 2 comments

Comments

@h3nrique
Copy link

Not accept Content-Type with charset

  • Plugin version 1.78
  • Jenkins version 2.319.1

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.
image

@tomasbjerre
Copy link
Contributor

Thanks for reporting. Released a fix now in 1.79. Open issue again if not working.

@h3nrique
Copy link
Author

Work like a charm. Thanks beast!!

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants