Skip to content

Fix Accept Header to use MediaType.WILDCARD#1318

Merged
jmini merged 1 commit into
gitlab4j:mainfrom
exceptionfactory:fix-accept-wildcard-header-1
May 2, 2026
Merged

Fix Accept Header to use MediaType.WILDCARD#1318
jmini merged 1 commit into
gitlab4j:mainfrom
exceptionfactory:fix-accept-wildcard-header-1

Conversation

@exceptionfactory

Copy link
Copy Markdown
Contributor

This pull request corrects the formatting of the HTTP Accept request header across multiple request methods to align with requirements defined in RFC 9110 Section 12.5.1.

The Jakarta REST API MediaType defines multiple constants including WILDCARD and MEDIA_TYPE_WILDCARD as follows:

  • MEDIA_TYPE_WILDCARD as *
  • WILDCARD as */*

Several methods in the GitLab4J API used the MEDIA_TYPE_WILDCARD constant, resulting in an invalid Accept header value of *, which should be limited to subtype references.

Following existing usage and aligning with RFC requirements, changing method calls to use the WILDCARD constant corrects the behavior and sends */* as the Accept header.

- Replaced MediaType.MEDIA_TYPE_WILDCARD with MediaType.WILDCARD as the Accept Header argument for calls to getWithAccepts

@jmini jmini left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This change looks good to me.

@exceptionfactory

Copy link
Copy Markdown
Contributor Author

Thanks for the review @jmini!

@jmini jmini merged commit da7e4c4 into gitlab4j:main May 2, 2026
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

Successfully merging this pull request may close these issues.

2 participants