Lines Matching refs:http2
44 #include "http2.h"
169 if (config->http2.upstream.debug.frame_debug) {
212 auto token = http2::lookup_token(namebuf.base, namebuf.len);
336 auto &dump = config->http2.upstream.debug.dump;
339 http2::dump_nv(dump.request_header, nva);
342 auto content_length = req.fs.header(http2::HD_CONTENT_LENGTH);
349 auto authority = req.fs.header(http2::HD__AUTHORITY);
350 auto path = req.fs.header(http2::HD__PATH);
351 auto method = req.fs.header(http2::HD__METHOD);
352 auto scheme = req.fs.header(http2::HD__SCHEME);
354 auto method_token = http2::lookup_method_token(method->value);
379 authority = req.fs.header(http2::HD_HOST);
394 req.path = http2::rewrite_clean_path(downstream->get_block_allocator(),
399 auto connect_proto = req.fs.header(http2::HD__PROTOCOL);
548 if (get_config()->http2.upstream.debug.frame_debug) {
665 if (get_config()->http2.upstream.debug.frame_debug) {
746 auto token = http2::lookup_token(nv.name, nv.namelen);
748 case http2::HD__METHOD:
749 req.method = http2::lookup_method_token(value);
751 case http2::HD__SCHEME:
754 case http2::HD__AUTHORITY:
757 case http2::HD__PATH:
758 req.path = http2::rewrite_clean_path(promised_balloc, value);
1002 if (config->http2.upstream.debug.frame_debug) {
1033 auto &http2conf = config->http2;
1185 auto &http2conf = config->http2;
1482 http2::copy_headers_to_nva_nocopy(nva, trailers, http2::HDOP_STRIP_ALL);
1530 auto response_status = http2::stringify_status(balloc, resp.http_status);
1532 nva.push_back(http2::make_nv_ls_nocopy(":status", response_status));
1539 case http2::HD_CONNECTION:
1540 case http2::HD_KEEP_ALIVE:
1541 case http2::HD_PROXY_CONNECTION:
1542 case http2::HD_TE:
1543 case http2::HD_TRANSFER_ENCODING:
1544 case http2::HD_UPGRADE:
1547 nva.push_back(http2::make_nv_nocopy(kv.name, kv.value, kv.no_index));
1550 if (!resp.fs.header(http2::HD_SERVER)) {
1551 nva.push_back(http2::make_nv_ls_nocopy("server", config->http.server_name));
1555 nva.push_back(http2::make_nv_nocopy(p.name, p.value));
1599 auto response_status = http2::stringify_status(balloc, status_code);
1604 {http2::make_nv_ls_nocopy(":status", response_status),
1605 http2::make_nv_ll("content-type", "text/html; charset=UTF-8"),
1606 http2::make_nv_ls_nocopy("server", get_config()->http.server_name),
1607 http2::make_nv_ls_nocopy("content-length", content_length),
1608 http2::make_nv_ls_nocopy("date", date)}};
1710 auto &http2conf = config->http2;
1715 // * Server push is disabled for http2 proxy or client proxy, since
1729 resp.fs.header(http2::HD_LINK) &&
1739 // 6 means :status and possible server, via, x-http2-push, alt-svc,
1745 auto response_status = http2::stringify_status(balloc, resp.http_status);
1747 nva.push_back(http2::make_nv_ls_nocopy(":status", response_status));
1749 http2::copy_headers_to_nva_nocopy(nva, resp.fs.headers(),
1750 http2::HDOP_STRIP_ALL);
1770 auto striphd_flags = http2::HDOP_STRIP_ALL & ~http2::HDOP_STRIP_VIA;
1774 response_status = http2::stringify_status(balloc, 200);
1775 striphd_flags |= http2::HDOP_STRIP_SEC_WEBSOCKET_ACCEPT;
1777 response_status = http2::stringify_status(balloc, resp.http_status);
1780 nva.push_back(http2::make_nv_ls_nocopy(":status", response_status));
1782 http2::copy_headers_to_nva_nocopy(nva, resp.fs.headers(), striphd_flags);
1785 nva.push_back(http2::make_nv_ls_nocopy("server", httpconf.server_name));
1787 auto server = resp.fs.header(http2::HD_SERVER);
1789 nva.push_back(http2::make_nv_ls_nocopy("server", (*server).value));
1805 nva.push_back(http2::make_nv_ls_nocopy("set-cookie", cookie_str));
1809 if (!resp.fs.header(http2::HD_ALT_SVC)) {
1812 nva.push_back(http2::make_nv_ls_nocopy(
1817 auto via = resp.fs.header(http2::HD_VIA);
1820 nva.push_back(http2::make_nv_ls_nocopy("via", (*via).value));
1839 nva.push_back(http2::make_nv_ls_nocopy("via", StringRef{iov.base, p}));
1843 nva.push_back(http2::make_nv_nocopy(p.name, p.value));
1849 nva.push_back(http2::make_nv_ll("x-http2-push", "1"));
1857 http2::dump_nv(http2conf.upstream.debug.dump.response_header, nva.data(),
2001 http2::HD_LOCATION);
2144 auto base = http2::get_pure_path_component(req.path);
2152 if (kv.token != http2::HD_LINK) {
2155 for (auto &link : http2::parse_link_header(kv.value)) {
2158 rv = http2::construct_push_component(balloc, scheme, authority, path,
2198 nva.push_back(http2::make_nv_ll(":method", "GET"));
2199 nva.push_back(http2::make_nv_ls_nocopy(":scheme", scheme));
2200 nva.push_back(http2::make_nv_ls_nocopy(":path", path));
2201 nva.push_back(http2::make_nv_ls_nocopy(":authority", authority));
2206 case http2::HD__AUTHORITY:
2207 case http2::HD__SCHEME:
2208 case http2::HD__METHOD:
2209 case http2::HD__PATH:
2211 case http2::HD_ACCEPT_ENCODING:
2212 case http2::HD_ACCEPT_LANGUAGE:
2213 case http2::HD_CACHE_CONTROL:
2214 case http2::HD_HOST:
2215 case http2::HD_USER_AGENT:
2216 nva.push_back(http2::make_nv_nocopy(kv.name, kv.value, kv.no_index));
2252 return !(config->http2.no_server_push ||
2268 auto base = http2::get_pure_path_component(req.path);
2277 rv = http2::construct_push_component(balloc, scheme, authority, path, base,
2360 nva.push_back(http2::make_nv(kv.name, kv.value, kv.no_index));