NASA-PDS / registry-api

Web API service for the PDS Registry, providing the implementation of the PDS Search API (https://github.com/nasa-pds/pds-api) for the PDS Registry.
https://nasa-pds.github.io/pds-api
Apache License 2.0
2 stars 5 forks source link

Handle Accept header with multiple values #529

Closed tloubrieu-jpl closed 1 month ago

tloubrieu-jpl commented 1 month ago

🗒️ Summary

We fix the handling of multiple Accept header as those provided by web browser.

Since the handling of this header value got a bit more complex, we moved the related code to the MVC configuration specifically.

⚙️ Test Data and/or Report

One of the following should be included here:

Use PR in registry repository https://github.com/NASA-PDS/registry/pull/318

Unit tests have also been added.

♻️ Related Issues

Fixes requirement #439

tloubrieu-jpl commented 1 month ago

Hi @jordanpadams , you noticed that bug yesterday and I cowardly pretended that was not a bug ;)

Actually, today I wanted to fix that because I was thinking if the API URL will not work from a browser that will make us have to answer more question and not look too good. So I looked at that, thinking this was more like a configuration issue, but realized there was an actual bug when multiple formats are proposed as supported returned format in the Accept header, e.g. text/html or application/svg, .... This is what web browsers do. This is now fixed.

jordanpadams commented 1 month ago

@tloubrieu-jpl I notice this has not yet been deployed to production? Unfortunately, most folks do the same thing I do which is put a URL into a browser, which doesn't work :-/ .