You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 13, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 13, 2026. It is now read-only.
Duplicated charset when storing a RiakObject with a content type with charset [JIRA: CLIENTS-602] #549
If I store a RiakObject with a content type of application/json;charset=UTF-8, the charset gets duplicated on the stored value when read by http, ending up with this content type: application/json;charset=UTF-8; charset=UTF-8
changed the title [-]Duplicated charset when storing a RiakObject with a content type with charset[/-][+]Duplicated charset when storing a RiakObject with a content type with charset [JIRA: CLIENTS-602][/+]on Sep 23, 2015
When we manually set a charset on the RiakObject, it actually goes onto the content-type [0].
When we convert the RiakObject to the ProtocolBuffer wire format, it will grab the charset off of the content-type buffer, but it won't remove it [1]. This is where we get the duplicate UTF-8.
When we convert from the ProtocolBuffer wire format back to a RiakObject, the charset gets put back onto the content-type [2], but de-dupes it in the process [3].
Also, according to the IETF, charset isn't a real optional parameter to the application/json content-type:
Note: No "charset" parameter is defined for this registration.
Adding one really has no effect on compliant recipients.
With that, we should stop putting the charset on the content-type automatically. If the user includes it in both fields, it will be duplicated by Webmachine (As seen in the reproducer). If they put each value in each field respectively, it should come out as expected in Webmachine.
If I store a RiakObject with a content type of
application/json;charset=UTF-8, the charset gets duplicated on the stored value when read by http, ending up with this content type:application/json;charset=UTF-8; charset=UTF-8I did a small sample to show the issue here:
https://github.com/gfbett/RiakIssueSample