Skip to content

Set the correct media type for login response and parse the Accept header #801

Open
marmoure wants to merge 1 commit into
developfrom
hotfix/output-media
Open

Set the correct media type for login response and parse the Accept header #801
marmoure wants to merge 1 commit into
developfrom
hotfix/output-media

Conversation

@marmoure
Copy link
Copy Markdown
Contributor

@marmoure marmoure commented May 21, 2026

This PR adds parsing for Accept header and introduces local:accept-json and local:preferred-media-type, it build on top of #800 to fix #253.
These functions allow more robust and future proof way for getting the appropriate header either the preferred one or a specific one.

Also when trying to set the correct headers for the login response using

util:declare-option("output:method", "json"),
util:declare-option("output:medita-type", "application/json"),

I encountered a bug in the RESTServer in writeResultJSON which ignored the output:medita-type option, I added evolvedbinary/elemental#212 for elemental and the same should be done for eXist-db.

In the mean time

response:set-header("Content-Type", "application/json; charset=UTF-8"),

is being used as workaround until this bug is resolved.

@marmoure marmoure force-pushed the hotfix/output-media branch from 19914a1 to bae133a Compare May 21, 2026 17:55
@marmoure marmoure marked this pull request as ready for review May 21, 2026 17:56
Copy link
Copy Markdown
Contributor

@duncdrum duncdrum left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @marmoure. The Xqdoc is not well-formed.

We don't normally link elemental issues. Feel free to keep it in alongside an exist issue. But both should be properly formatted.

Please add a test. Did you test this against exist? Which version?

@marmoure marmoure force-pushed the hotfix/output-media branch from bae133a to 9fe078a Compare May 22, 2026 09:01
@marmoure
Copy link
Copy Markdown
Contributor Author

Thanks for the @duncdrum I fixed the xqdoc issue, this was tested on eXist-db 6.4.1.

@marmoure marmoure requested a review from duncdrum May 26, 2026 08:48
@duncdrum
Copy link
Copy Markdown
Contributor

@marmoure could you add a test for the request to the testsuite, so we see how this plays in against different backends.

@adamretter
Copy link
Copy Markdown
Contributor

@duncdrum I believe that @marmoure has mentioned in the past that the eXide test suite is flaky, but it doesn't look like that has been addressed since then. Therefore we don't have much confidence in the eXide test suite.

We sent this code as a courtesy on behalf of one of your users of eXide. I am very reluctant to have @marmoure invest more time in this, because (a) we already have a fix for Elemental, and (b) previous attempts where we invested significant time into improving the eXist-db Apps in collaboration with you did not go well (i.e. eXist-db/monex#298).

Can you provide any sort of assurance that if we invest further time and that if @marmoure provides a test for this, then you will merge it?

Thanks.

@duncdrum
Copy link
Copy Markdown
Contributor

@adamretter our review policy hasn't changed. You can see #799 for reference. Comparing this here to the full rewrite of monex is comparing apples to oranges.

What I can assure you is that I won't merge without a test. If you wish to invest more time into this version of eXide in light of #794 is up to you.

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.

[BUG] XML Parsing Error in console

3 participants