Skip to content

Fix Accept Header to use MediaType.WILDCARD#1318

Open
exceptionfactory wants to merge 1 commit intogitlab4j:mainfrom
exceptionfactory:fix-accept-wildcard-header-1
Open

Fix Accept Header to use MediaType.WILDCARD#1318
exceptionfactory wants to merge 1 commit intogitlab4j:mainfrom
exceptionfactory:fix-accept-wildcard-header-1

Conversation

@exceptionfactory
Copy link

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

1 participant