THRIFT-4446: JSONProtocol Base64 Encoding: Do not trim padding on encode.
Client: csharp
Client: netcore
This closes #1463
diff --git a/lib/csharp/src/Protocol/TJSONProtocol.cs b/lib/csharp/src/Protocol/TJSONProtocol.cs
index 5e6589e..0ceb675 100644
--- a/lib/csharp/src/Protocol/TJSONProtocol.cs
+++ b/lib/csharp/src/Protocol/TJSONProtocol.cs
@@ -544,11 +544,6 @@
int len = b.Length;
int off = 0;
- // Ignore padding
- int bound = len >= 2 ? len - 2 : 0;
- for (int i = len - 1; i >= bound && b[i] == '='; --i) {
- --len;
- }
while (len >= 3)
{
// Encode 3 bytes at a time
diff --git a/lib/netcore/Thrift/Protocols/TJSONProtocol.cs b/lib/netcore/Thrift/Protocols/TJSONProtocol.cs
index a4ddd5b..17aa5f7 100644
--- a/lib/netcore/Thrift/Protocols/TJSONProtocol.cs
+++ b/lib/netcore/Thrift/Protocols/TJSONProtocol.cs
@@ -384,14 +384,6 @@
var len = b.Length;
var off = 0;
- // Ignore padding
- var bound = len >= 2 ? len - 2 : 0;
-
- for (var i = len - 1; i >= bound && b[i] == '='; --i)
- {
- --len;
- }
-
while (len >= 3)
{
// Encode 3 bytes at a time
@@ -1167,4 +1159,4 @@
}
}
}
-}
\ No newline at end of file
+}