Lines Matching refs:req

140   auto &req = downstream->request();
145 req.method = htp->method;
147 if (req.fs.buffer_size() + len >
151 << req.fs.buffer_size() + len;
160 req.fs.add_extra_buffer_size(len);
162 if (req.method == HTTP_CONNECT) {
163 req.authority =
164 concat_string_ref(balloc, req.authority, StringRef{data, len});
166 req.path = concat_string_ref(balloc, req.path, StringRef{data, len});
177 auto &req = downstream->request();
180 if (req.fs.buffer_size() + len > httpconf.request_header_field_buffer) {
183 << req.fs.buffer_size() + len;
193 if (req.fs.header_key_prev()) {
194 req.fs.append_last_header_key(data, len);
196 if (req.fs.num_fields() >= httpconf.max_request_header_fields) {
199 << "Too many header field num=" << req.fs.num_fields() + 1;
206 req.fs.alloc_add_header_name(StringRef{data, len});
210 if (req.fs.trailer_key_prev()) {
211 req.fs.append_last_trailer_key(data, len);
213 if (req.fs.num_fields() >= httpconf.max_request_header_fields) {
216 << "Too many header field num=" << req.fs.num_fields() + 1;
221 req.fs.alloc_add_trailer_name(StringRef{data, len});
232 auto &req = downstream->request();
234 if (req.fs.buffer_size() + len >
238 << req.fs.buffer_size() + len;
248 req.fs.append_last_header_value(data, len);
250 req.fs.append_last_trailer_value(data, len);
257 void rewrite_request_host_path_from_uri(BlockAllocator &balloc, Request &req,
292 req.authority = StringRef{iovec.base, p};
294 req.authority = authority;
297 req.scheme = util::get_uri_field(uri.c_str(), u, UF_SCHEMA);
302 } else if (req.method == HTTP_OPTIONS) {
309 req.path = StringRef::from_lit("");
328 req.path = http2::rewrite_clean_path(balloc, path);
343 auto &req = downstream->request();
346 for (auto &kv : req.fs.headers()) {
357 req.tstamp = lgconf->tstamp;
359 req.http_major = htp->http_major;
360 req.http_minor = htp->http_minor;
362 req.connection_close = !llhttp_should_keep_alive(htp);
366 auto method = req.method;
371 << (method == HTTP_CONNECT ? req.authority : req.path) << " "
372 << "HTTP/" << req.http_major << "." << req.http_minor << "\n";
374 for (const auto &kv : req.fs.headers()) {
387 // req.fs.content_length to -1.
388 if (method != HTTP_CONNECT && !req.fs.header(http2::HD_TRANSFER_ENCODING)) {
393 req.fs.content_length = htp->content_length;
396 auto host = req.fs.header(http2::HD_HOST);
398 if (req.http_major > 1 || req.http_minor > 1) {
399 req.http_major = 1;
400 req.http_minor = 1;
404 if (req.http_major == 1 && req.http_minor == 1 && !host) {
426 auto transfer_encoding = req.fs.header(http2::HD_TRANSFER_ENCODING);
428 http2::legacy_http1(req.http_major, req.http_minor)) {
437 rv = http_parser_parse_url(req.path.c_str(), req.path.size(), 0, &u);
444 req.no_authority = true;
446 if (method == HTTP_OPTIONS && req.path == StringRef::from_lit("*")) {
447 req.path = StringRef{};
449 req.path = http2::rewrite_clean_path(balloc, req.path);
453 req.authority = host->value;
457 req.scheme = StringRef::from_lit("https");
459 req.scheme = StringRef::from_lit("http");
462 rewrite_request_host_path_from_uri(balloc, req, req.path, u);
471 !http::check_http_scheme(req.scheme, handler->get_ssl() != nullptr)) {
488 if (req.no_authority && config->http2_proxy &&
590 auto &req = downstream->request();
593 for (auto &kv : req.fs.trailers()) {
979 const auto &req = downstream->request();
995 } else if (req.http_major <= 0 ||
996 (req.http_major == 1 && req.http_minor == 0)) {
1123 const auto &req = downstream->request();
1166 auto connect_method = req.method == HTTP_CONNECT;
1170 buf->append('0' + req.http_major);
1172 buf->append('0' + req.http_minor);
1174 if (req.connect_proto != ConnectProto::NONE && downstream->get_upgraded()) {
1209 (!http2::legacy_http1(req.http_major, req.http_minor)
1226 if (!req.connection_close && !resp.connection_close) {
1227 if (req.http_major <= 0 || req.http_minor <= 0) {
1236 if (req.connect_proto == ConnectProto::WEBSOCKET &&
1239 auto key = req.fs.header(http2::HD_SEC_WEBSOCKET_KEY);
1290 if (req.method != HTTP_CONNECT || !downstream->get_upgraded()) {
1297 http::require_cookie_secure_attribute(cookieconf.secure, req.scheme);
1364 const auto &req = downstream->request();
1387 if (req.connection_close || resp.connection_close ||
1411 auto &req = downstream->request();
1412 if (req.method == HTTP_CONNECT || req.scheme != "http" ||
1413 req.authority.empty()) {
1418 auto authority = util::extract_host(req.authority);
1431 req.path);
1435 httpconf.redirect_https_port, req.path);