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

Improve Content Negotiation #703

Merged
merged 1 commit into from
May 6, 2022
Merged

Improve Content Negotiation #703

merged 1 commit into from
May 6, 2022

Conversation

alexanderkiel
Copy link
Member

@alexanderkiel alexanderkiel commented May 5, 2022

Refactored some Ring handlers into the Ring async style, because reitit runs the not-acceptable default handler on nil returning handlers which doesn't work when a future is returned.

@codecov
Copy link

codecov bot commented May 5, 2022

Codecov Report

Merging #703 (2ebca6a) into develop (b3e9677) will increase coverage by 0.00%.
The diff coverage is 98.41%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #703   +/-   ##
========================================
  Coverage    93.64%   93.64%           
========================================
  Files          237      237           
  Lines        14156    14173   +17     
  Branches       356      356           
========================================
+ Hits         13256    13272   +16     
- Misses         544      545    +1     
  Partials       356      356           
Impacted Files Coverage Δ
modules/rest-api/src/blaze/rest_api/routes.clj 98.81% <94.11%> (-0.53%) ⬇️
modules/db/src/blaze/db/api.clj 82.88% <100.00%> (+0.31%) ⬆️
modules/db/src/blaze/db/node.clj 97.32% <100.00%> (+0.02%) ⬆️
.../interaction/src/blaze/interaction/search_type.clj 97.46% <100.00%> (+0.01%) ⬆️
modules/rest-api/src/blaze/rest_api.clj 89.06% <100.00%> (-0.49%) ⬇️
...es/rest-api/src/blaze/rest_api/middleware/cors.clj 100.00% <100.00%> (ø)
...st-api/src/blaze/rest_api/middleware/forwarded.clj 100.00% <100.00%> (ø)
...les/rest-api/src/blaze/rest_api/middleware/log.clj 100.00% <100.00%> (ø)
.../rest-api/src/blaze/rest_api/middleware/output.clj 100.00% <100.00%> (ø)
modules/rest-util/src/blaze/handler/util.clj 68.80% <100.00%> (-1.88%) ⬇️
... and 1 more

Refactored some Ring handlers into the Ring async style, because reitit
runs the not-acceptable default handler on nil returning handlers which
doesn't work when a future is returned.
@alexanderkiel alexanderkiel merged commit 13580cd into develop May 6, 2022
@alexanderkiel alexanderkiel deleted the accept branch May 6, 2022 11:11
alexanderkiel added a commit that referenced this pull request May 10, 2022
This fixes a regression introduced by #703 where we don't return JSON
by default if an Accept header is present. This is relevant in
situations where browsers start with text/html but also will accept
application/xml with lower priority. Instead of returning a 406 in this
cases, XML is delivered now.

If one prefers JSON in browsers the _format query param has to be used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant