| 277 | } |
| 278 | |
| 279 | public static Http2Headers convertClientHeaders(Metadata headers, |
| 280 | AsciiString scheme, |
| 281 | AsciiString defaultPath, |
| 282 | AsciiString authority, |
| 283 | AsciiString method, |
| 284 | AsciiString userAgent) { |
| 285 | Preconditions.checkNotNull(defaultPath, "defaultPath"); |
| 286 | Preconditions.checkNotNull(authority, "authority"); |
| 287 | Preconditions.checkNotNull(method, "method"); |
| 288 | |
| 289 | // Discard any application supplied duplicates of the reserved headers |
| 290 | headers.discardAll(CONTENT_TYPE_KEY); |
| 291 | headers.discardAll(GrpcUtil.TE_HEADER); |
| 292 | headers.discardAll(GrpcUtil.USER_AGENT_KEY); |
| 293 | |
| 294 | return GrpcHttp2OutboundHeaders.clientRequestHeaders( |
| 295 | toHttp2Headers(headers), |
| 296 | authority, |
| 297 | defaultPath, |
| 298 | method, |
| 299 | scheme, |
| 300 | userAgent); |
| 301 | } |
| 302 | |
| 303 | public static Http2Headers convertServerHeaders(Metadata headers) { |
| 304 | // Discard any application supplied duplicates of the reserved headers |