Issue #2672 Allow One extra null byte in RemoteRequestRouteWrapper.
Former-commit-id:40bc9df420
[formerly 7463bf7c3efbdf8eb184f24bfc9c6a12c57d5006] Former-commit-id:3d08979eee
This commit is contained in:
parent
9f2d49e31d
commit
3bc210a1f1
1 changed files with 12 additions and 1 deletions
|
@ -67,7 +67,18 @@ public class RemoteRequestRouteWrapper {
|
|||
Object obj = SerializationUtil.transformFromThrift(Object.class,
|
||||
data);
|
||||
int remaining = data.available();
|
||||
if (remaining > 0) {
|
||||
if (remaining == 1) {
|
||||
int tail = data.read();
|
||||
/*
|
||||
* When http proxies are being used there is a single null
|
||||
* character at the end of the message, no need to panic.
|
||||
*/
|
||||
if (tail != 0x00) {
|
||||
throw new IllegalStateException(
|
||||
"Unexpected byte remaining after deserialization: "
|
||||
+ tail);
|
||||
}
|
||||
} else if (remaining > 0) {
|
||||
throw new IllegalStateException(remaining
|
||||
+ " unexpected bytes remaining after deserialization");
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue