Skip to content

Add any media type to RFC9457 content type header#1894

Merged
slawekjaranowski merged 2 commits into
apache:masterfrom
slawekjaranowski:rfc9457-with-any
May 30, 2026
Merged

Add any media type to RFC9457 content type header#1894
slawekjaranowski merged 2 commits into
apache:masterfrom
slawekjaranowski:rfc9457-with-any

Conversation

@slawekjaranowski
Copy link
Copy Markdown
Member

Tested with ASF nexus 2.x

@slawekjaranowski
Copy link
Copy Markdown
Member Author

#1891 (review)

Copy link
Copy Markdown
Member

@kwin kwin left a comment

Choose a reason for hiding this comment

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

Just one suggestion, otherwise looks good.

*/
public abstract class RFC9457Reporter<T, E extends Exception, R> {
public static final String CONTENT_TYPE_PROBLEM_DETAILS_JSON = "application/problem+json";
public static final String CONTENT_TYPE_PROBLEM_DETAILS_JSON_WITH_ANY = "application/problem+json, */*";
Copy link
Copy Markdown
Member

@kwin kwin May 29, 2026

Choose a reason for hiding this comment

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

Suggested change
public static final String CONTENT_TYPE_PROBLEM_DETAILS_JSON_WITH_ANY = "application/problem+json, */*";
public static final String CONTENT_TYPE_PROBLEM_DETAILS_JSON_AND_ANY = "application/problem+json,*/*";

Also no space in CSV!

@cstamas cstamas added this to the 2.0.19 milestone May 29, 2026
@cstamas cstamas added the enhancement New feature or request label May 29, 2026
@olamy
Copy link
Copy Markdown
Member

olamy commented May 29, 2026

interesting I didn't know */* was not including application/problem+json :)
Did it work with only */*?
Looks more like a Nexus bug? (any reference?) (or some Jetty issue on Nexus server side?)
Well on the other side this mean I prefer this application/problem+json but otherwise no worries I can accept everything

@cstamas
Copy link
Copy Markdown
Member

cstamas commented May 29, 2026

This is not Jetty but Restlet (ancient 1.1.x), and is set to "strict" mode, which means "do not assume anything else than client states".

@kwin
Copy link
Copy Markdown
Member

kwin commented May 30, 2026

Cloudflare needs explicit problem+json (https://blog.cloudflare.com/rfc-9457-agent-error-pages/), other servers probably as well.

@slawekjaranowski slawekjaranowski merged commit dc3999f into apache:master May 30, 2026
14 checks passed
@slawekjaranowski slawekjaranowski deleted the rfc9457-with-any branch May 30, 2026 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants