r->method_name = ngx_http_core_get_method;
r->method = NGX_HTTP_GET;
- r->schema_start = (u_char *) "https";
-
#if (NGX_HTTP_SSL)
if (fc->ssl) {
- r->schema_end = r->schema_start + 5;
+ ngx_str_set(&r->schema, "https");
} else
#endif
{
- r->schema_end = r->schema_start + 4;
+ ngx_str_set(&r->schema, "http");
}
value.data = ngx_pstrdup(pool, path);
u_char c, ch;
ngx_uint_t i;
- if (r->schema_start) {
+ if (r->schema.len) {
ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
"client sent duplicate :scheme header");
return NGX_DECLINED;
}
- r->schema_start = value->data;
- r->schema_end = value->data + value->len;
+ r->schema = *value;
return NGX_OK;
}
static const u_char ending[] = " HTTP/2.0";
if (r->method_name.len == 0
- || r->schema_start == NULL
+ || r->schema.len == 0
|| r->unparsed_uri.len == 0)
{
if (r->method_name.len == 0) {
ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
"client sent no :method header");
- } else if (r->schema_start == NULL) {
+ } else if (r->schema.len == 0) {
ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
"client sent no :scheme header");