Skip to content

Conversation

@Fluder-Paradyne
Copy link
Contributor

Added a null check in ResponseContentSupplier.readCharset() to handle responses without a Content-Type header. Previously, the code would throw a NullPointerException when processing 204 No Content responses (such as those from GitHub Actions API) because it attempted to call .getValue() on a null header. The fix now checks if the Content-Type header exists before accessing its value, allowing these responses to be processed successfully.

Also added a test case to verify that responses without Content-Type headers are handled correctly.

Testing done

Ran the tests without the fix and the test failed.

Issue link

https://issues.jenkins.io/browse/JENKINS-76231

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

@Fluder-Paradyne Fluder-Paradyne requested a review from a team as a code owner October 22, 2025 14:10
@MarkEWaite MarkEWaite added the bug label Oct 22, 2025
Copy link
Contributor

@MarkEWaite MarkEWaite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks very much! I confirmed that the test shows the bug when the main code is not included and the test passes when the main code is included.

@MarkEWaite MarkEWaite enabled auto-merge (squash) October 22, 2025 14:59
@MarkEWaite MarkEWaite merged commit a7abe6c into jenkinsci:master Oct 22, 2025
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants