From d2046b637da8675d88f50fa3f4a000fc14e54e51 Mon Sep 17 00:00:00 2001 From: Carl Mastrangelo Date: Wed, 16 Sep 2015 09:48:11 -0700 Subject: [PATCH] Allow commas in Metadata values --- core/src/main/java/io/grpc/Metadata.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/io/grpc/Metadata.java b/core/src/main/java/io/grpc/Metadata.java index 8172011210..b7e85aaeae 100644 --- a/core/src/main/java/io/grpc/Metadata.java +++ b/core/src/main/java/io/grpc/Metadata.java @@ -161,6 +161,7 @@ public final class Metadata { * may not be accurate if Metadata is mutated. */ public Iterable getAll(final Key key) { + if (containsKey(key)) { return Iterables.transform( store.get(key.name()), @@ -332,7 +333,7 @@ public final class Metadata { * following characters: *
    *
  • Space: {@code 0x20}, but must not be at the beginning or at the end of the value.
  • - *
  • ASCII visible characters ({@code 0x21-0x7E}), but excluding comma ({@code ",", 0x2C}). + *
  • ASCII visible characters ({@code 0x21-0x7E}). *
* *

Note this has to be the subset of valid characters in {@code field-content} from RFC 7230