Content type stored as Constants/CTYPE_JSON_UTF8 is read as a different string #125

michaelklishin opened this Issue Apr 25, 2012 · 1 comment


None yet
2 participants

michaelklishin commented Apr 25, 2012

In Welle we have a "smart" deserialization feature that works like this: if IRiakObject content type is known, we deserialize the value automatically for common formats like text or JSON. During this process, IRiakObject's content type is compared with the Constants/CTYPE_JSON_UTF8 value. In 1.1 this value is

public static String CTYPE_JSON_UTF8 = "application/json;charset=UTF-8";

note that there is no space between base content type and parameters. This is not a problem in general but when content type is read from IRiakObject, the space between base type and parameter list magically appears and comparison fails: application/json;charset=UTF-8" is not equal to application/json; charset=UTF-8".

This is a very annoying problem that makes the constant rather useless.

@ghost ghost assigned broach May 21, 2012


broach commented May 30, 2012

Addressed in PR #136

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment