Skip to content

[6.x.x] Add media type to writeResultJSON response header - #222

Merged
adamretter merged 2 commits into
develop-6.x.xfrom
6.x.x/hotfix/json-response
Jun 3, 2026
Merged

[6.x.x] Add media type to writeResultJSON response header#222
adamretter merged 2 commits into
develop-6.x.xfrom
6.x.x/hotfix/json-response

Conversation

@adamretter

Copy link
Copy Markdown
Member

Backport of #212

RESTServer#writeResultJSON Ignores the XQuery Serialization output media type setting and does not set the Content Type correctly in the HTTP Response, this PR fixes that, and enables support for:

util:declare-option("output:media-type", "application/json")
declareoption output:media-type"application/json";

This PR also adds tests for RESTService to make sure it returns the correct Content-Type headers and prioritize it over the request Accept headers.

@adamretteradamretter added this to the elemental-6.10.1 milestone Jun 3, 2026
@adamretteradamretter self-assigned this Jun 3, 2026
@adamretteradamretter added the bug Something isn't working label Jun 3, 2026
@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@adamretter
adamretter merged commit e785fb3 into develop-6.x.xJun 3, 2026
10 of 13 checks passed
@adamretter
adamretter deleted the 6.x.x/hotfix/json-response branch June 3, 2026 17:50
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugSomething isn't workingcla-signed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@adamretter@marmoure