@Test public void setHttp2AuthorityWithUserInfo() { Http2Headers headers = new DefaultHttp2Headers(); HttpConversionUtil.setHttp2Authority("info@foo", headers); assertEquals(new AsciiString("foo"), headers.authority()); HttpConversionUtil.setHttp2Authority("@foo.bar", headers); assertEquals(new AsciiString("foo.bar"), headers.authority()); }
static void setHttp2Authority(String authority, Http2Headers out) { if (authority != null) { if (authority.isEmpty()) { out.authority(EMPTY_STRING); } else { int start = authority.indexOf('@') + 1; int length = authority.length() - start; if (length == 0) { throw new IllegalArgumentException("authority: " + authority); } out.authority(new AsciiString(authority, start, length)); } } }
HttpConversionUtil { static void setHttp2Authority(String authority, Http2Headers out) { if (authority != null) { if (authority.isEmpty()) { out.authority(EMPTY_STRING); } else { int start = authority.indexOf('@') + 1; int length = authority.length() - start; if (length == 0) { throw new IllegalArgumentException("authority: " + authority); } out.authority(new AsciiString(authority, start, length)); } } } }
HttpConversionUtil { static void setHttp2Authority(String authority, Http2Headers out) { if (authority != null) { if (authority.isEmpty()) { out.authority(EMPTY_STRING); } else { int start = authority.indexOf('@') + 1; int length = authority.length() - start; if (length == 0) { throw new IllegalArgumentException("authority: " + authority); } out.authority(new AsciiString(authority, start, length)); } } } private  HttpConversionUtil(); }
HttpConversionUtil { static void setHttp2Authority(String authority, Http2Headers out) { if (authority != null) { if (authority.isEmpty()) { out.authority(EMPTY_STRING); } else { int start = authority.indexOf('@') + 1; int length = authority.length() - start; if (length == 0) { throw new IllegalArgumentException("authority: " + authority); } out.authority(new AsciiString(authority, start, length)); } } } private  HttpConversionUtil(); static HttpResponseStatus parseStatus(CharSequence status); static FullHttpResponse toFullHttpResponse(int streamId, Http2Headers http2Headers, ByteBufAllocator alloc,
                                                      boolean validateHttpHeaders); static FullHttpRequest toFullHttpRequest(int streamId, Http2Headers http2Headers, ByteBufAllocator alloc,
                                                boolean validateHttpHeaders); static HttpRequest toHttpRequest(int streamId, Http2Headers http2Headers, boolean validateHttpHeaders); static HttpResponse toHttpResponse(final int streamId,
                                              final Http2Headers http2Headers,
                                              final boolean validateHttpHeaders); static void addHttp2ToHttpHeaders(int streamId, Http2Headers sourceHeaders,
                    FullHttpMessage destinationMessage, boolean addToTrailer); static void addHttp2ToHttpHeaders(int streamId, Http2Headers inputHeaders, HttpHeaders outputHeaders,
            HttpVersion httpVersion, boolean isTrailer, boolean isRequest); static Http2Headers toHttp2Headers(HttpMessage in, boolean validateHeaders); static Http2Headers toHttp2Headers(HttpHeaders inHeaders, boolean validateHeaders); static void toHttp2Headers(HttpHeaders inHeaders, Http2Headers out); }
HttpConversionUtil { static void setHttp2Authority(String authority, Http2Headers out) { if (authority != null) { if (authority.isEmpty()) { out.authority(EMPTY_STRING); } else { int start = authority.indexOf('@') + 1; int length = authority.length() - start; if (length == 0) { throw new IllegalArgumentException("authority: " + authority); } out.authority(new AsciiString(authority, start, length)); } } } private  HttpConversionUtil(); static HttpResponseStatus parseStatus(CharSequence status); static FullHttpResponse toFullHttpResponse(int streamId, Http2Headers http2Headers, ByteBufAllocator alloc,
                                                      boolean validateHttpHeaders); static FullHttpRequest toFullHttpRequest(int streamId, Http2Headers http2Headers, ByteBufAllocator alloc,
                                                boolean validateHttpHeaders); static HttpRequest toHttpRequest(int streamId, Http2Headers http2Headers, boolean validateHttpHeaders); static HttpResponse toHttpResponse(final int streamId,
                                              final Http2Headers http2Headers,
                                              final boolean validateHttpHeaders); static void addHttp2ToHttpHeaders(int streamId, Http2Headers sourceHeaders,
                    FullHttpMessage destinationMessage, boolean addToTrailer); static void addHttp2ToHttpHeaders(int streamId, Http2Headers inputHeaders, HttpHeaders outputHeaders,
            HttpVersion httpVersion, boolean isTrailer, boolean isRequest); static Http2Headers toHttp2Headers(HttpMessage in, boolean validateHeaders); static Http2Headers toHttp2Headers(HttpHeaders inHeaders, boolean validateHeaders); static void toHttp2Headers(HttpHeaders inHeaders, Http2Headers out); static final HttpMethod OUT_OF_MESSAGE_SEQUENCE_METHOD; static final String OUT_OF_MESSAGE_SEQUENCE_PATH; static final HttpResponseStatus OUT_OF_MESSAGE_SEQUENCE_RETURN_CODE; }