thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James E. King, III (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (THRIFT-4446) JSONProtocol Base64 Encoding Trims Padding
Date Thu, 11 Jan 2018 02:15:00 GMT

     [ https://issues.apache.org/jira/browse/THRIFT-4446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

James E. King, III resolved THRIFT-4446.
----------------------------------------
       Resolution: Fixed
    Fix Version/s: 0.12.0

Committed - thanks!

> JSONProtocol Base64 Encoding Trims Padding
> ------------------------------------------
>
>                 Key: THRIFT-4446
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4446
>             Project: Thrift
>          Issue Type: Bug
>          Components: .NETCore - Library, C# - Library
>    Affects Versions: 0.11.0
>            Reporter: Allen
>            Assignee: James E. King, III
>             Fix For: 0.12.0
>
>
> In the C# and .NET Core libraries, the JSONProtocol's Binary Encoding to Base64 trims
padding from the user provided byte arrays before encoding into Base64. This behavior is incorrect,
as the user provided data should be encoded exactly as provided. Otherwise, data may be lost.
> Fixed by no longer trimming padding on encode. Padding must still be trimmed on decode,
in accordance with the Base64 specification.
> For example:
> * Before this patch, encoding the byte array [0x01, 0x3d, 0x3d] yields [0x01] upon decode.
This is incorrect, as I should decode the exact data that I encoded.
> * After this patch, it yields [0x01, 0x3d, 0x3d], as expected.
> I have submitted a pull request [here|https://github.com/apache/thrift/pull/1463]



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message