Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Accept header with multiple values #529

Merged
merged 2 commits into from
Aug 22, 2024
Merged

Conversation

tloubrieu-jpl
Copy link
Member

🗒️ 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:

  • Reference to regression test included in code (preferred wherever reasonable)
  • Attach test data here + outputs of tests

Use PR in registry repository NASA-PDS/registry#318

Unit tests have also been added.

♻️ Related Issues

Fixes requirement #439

@tloubrieu-jpl
Copy link
Member Author

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.

Copy link
Contributor

@alexdunnjpl alexdunnjpl left a comment

Choose a reason for hiding this comment

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

LGTM

@tloubrieu-jpl tloubrieu-jpl merged commit d26e447 into develop Aug 22, 2024
1 check failed
@tloubrieu-jpl tloubrieu-jpl deleted the fix_accept branch August 22, 2024 15:04
@jordanpadams
Copy link
Member

@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 :-/ .

tloubrieu-jpl added a commit that referenced this pull request Sep 3, 2024
…h Serverless (#531)

* implement RegistrySearchRequestBuilder.applyMultipleProductsDefaults()

* switch /products and membership endpoints to use applyMultipleProductsDefaults()

* rename RegistrySearchRequestBuilder.onlyLatest() to noSupersededProducts()
the semantics of the new name are clearer and cannot lead to confusion about its behaviour

* fix terraform deployment on MCP dev

* add ssm parameter to share the load balancer domain with other components

* rename noSupersededProduct -> excludeSupersededProducts

* update application.properties for latest code

* make operator, NOT, LIKE, AND, OR antlr tokens case-insensitive

* add Query parameter to membership endpoints (#526)

* Handle Accept header with multiple values (#529)

* properly manage Accept header with multiple options

* move MVC function in appropriate class, add unit tests

---------

Co-authored-by: thomas loubrieu <thomas.loubrieu@jpl.nasa.gov>

* implement PdsProperty

* apply propertiesList response schema to '*' content-type

* implement /properties endpoint

* add warning on /docs end-point which does not work yet

---------

Co-authored-by: edunn <alexander.e.dunn@jpl.nasa.gov>
Co-authored-by: thomas loubrieu <thomas.loubrieu@jpl.nasa.gov>
Co-authored-by: Jordan Padams <33492486+jordanpadams@users.noreply.github.com>
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.

3 participants