Edirom / Edirom-Online

Edirom Online is a tool for presenting historical-critical music editions in digital form.
GNU General Public License v3.0
19 stars 18 forks source link

[BUG] several wrong output methods and media types returned from XQuery endpoints #417

Open peterstadler opened 1 week ago

peterstadler commented 1 week ago

Describe the problem

Several EOL endpoints return false output methods and media types. E.g. getWorks.xql returns plain text as stated in the Content-Type return header but in fact returns JSON.

Other endpoints like getPreferences.xql may return JSON or XML depending on an URL request parameter but will always state to return "text/html".

Lastly, there are some endpoints like getAnnotation.xql that declare an output method and serialize the data in a different way. That should IMHO be rewritten.

I'm happily volunteering to do this work if you think that is helpful.

bwbohl commented 1 week ago

Many thanks for spotting these inconsistencies; yes, they should be rewritten!

There may be dragons, nevertheless, in the JS methods processing the returns of the XQueries. Sometimes, in the JS processing of the response, it’s being parsed to match the intended result.

peterstadler commented 1 week ago

Many thanks for the heads up! I understand that the frontend functionality has to be checked thoroughly after the proposed changes to the backend.