 +static ngx_int_t
 +ngx_http_v3_parse_scheme(ngx_http_request_t *r, ngx_str_t *value)
 +{
-+    if (r->schema_start) {
++    u_char      c, ch;
++    ngx_uint_t  i;
++
++    if (r->schema.len) {
 +        ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
 +                      "client sent duplicate :scheme header");
 +

+
+#endif /* _NGX_HTTP_V3_MODULE_H_INCLUDED_ */
-- 
2.26.2


+        return NGX_DECLINED;
+    }
+
+    for (i = 0; i < value->len; i++) {
+        ch = value->data[i];
+
+        c = (u_char) (ch | 0x20);
+        if (c >= 'a' && c <= 'z') {
+            continue;
+        }
+
+        if (((ch >= '0' && ch <= '9') || ch == '+' || ch == '-' || ch == '.')
+            && i > 0)
+        {
+            continue;
+        }
+
+        ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
+                      "client sent invalid :scheme header: \"%V\"", value);
+
+        return NGX_DECLINED;
+    }
+
+    r->schema = *value;
+
+    return NGX_OK;
+}
