question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom media handlers: Unexpected issue when providing custom json handler

See original GitHub issue

This is in falcon-2.0

Look at the documentation here for using rapidjson for encoding/decoding json. By providing:

extra_handlers={'application/json': json_handler} we are still left with the default handler for content-type application-json; charset=UTF-8. This results in an unexpected behaviour when some client library (e.g. Retrofit for Android) includes the charset in the header.

While the documentation should be updated, the expected behaviour is that if the handler for application/json is updated - it should also update the handler for variant with charset (or at least throw a warning) otherwise there is a possibility of hidden bugs.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:19 (18 by maintainers)

github_iconTop GitHub Comments

1reaction
CaselITcommented, Nov 23, 2020

I’ll open a new issue regarding this, since it’s only tangentially related to this one

1reaction
adsahaycommented, Jul 21, 2020

Ok sure.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Errors - Fastify
When a custom error handler has been defined through setErrorHandler , the custom error handler will receive the error passed to the done()...
Read more >
A Guide to Error Handling in Express.js | Scout APM Blog
Handling Custom Errors. Express's default error-handling middleware is super helpful for beginners to take care of unexpected, unhandled errors.
Read more >
Error Handling — Falcon 3.1.1 documentation
If a custom media type is used and the type includes a “+json” or “+xml” suffix, the default serializer will convert the error...
Read more >
Testing Spring MVC @ExceptionHandler method with Spring ...
I have the following simple controller to catch any unexpected exceptions: @ControllerAdvice public class ExceptionController { ...
Read more >
Python Logging Guide - Best Practices and Hands-on Examples
access logs and their format can be customized in conf. ... based on the handler's logging level and user-provided handler-specific filters.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found