(Metadata headers, String headerName)
| 172 | } |
| 173 | |
| 174 | @Nullable |
| 175 | private static String getHeaderValue(Metadata headers, String headerName) { |
| 176 | if (headerName.endsWith(Metadata.BINARY_HEADER_SUFFIX)) { |
| 177 | return null; |
| 178 | } |
| 179 | if (headerName.equals("content-type")) { |
| 180 | return "application/grpc"; |
| 181 | } |
| 182 | Metadata.Key<String> key; |
| 183 | try { |
| 184 | key = Metadata.Key.of(headerName, Metadata.ASCII_STRING_MARSHALLER); |
| 185 | } catch (IllegalArgumentException e) { |
| 186 | return null; |
| 187 | } |
| 188 | Iterable<String> values = headers.getAll(key); |
| 189 | return values == null ? null : Joiner.on(",").join(values); |
| 190 | } |
| 191 | } |
no test coverage detected