From 2892c32fb50995b5b4c708fcae7dbe9a1d374d18 Mon Sep 17 00:00:00 2001
From: Francesco Giacomini <francesco.giacomini@cnaf.infn.it>
Date: Wed, 1 Dec 2021 16:48:09 +0100
Subject: [PATCH] Keep the httpg patch in this repository

---
 nginx-httpg_no_delegation.patch | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 nginx-httpg_no_delegation.patch

diff --git a/nginx-httpg_no_delegation.patch b/nginx-httpg_no_delegation.patch
new file mode 100644
index 0000000..71bcfba
--- /dev/null
+++ b/nginx-httpg_no_delegation.patch
@@ -0,0 +1,19 @@
+diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c
+index d9a1dbed..7438816e 100644
+--- a/src/http/ngx_http_parse.c
++++ b/src/http/ngx_http_parse.c
+@@ -149,7 +149,13 @@ ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b)
+                 break;
+             }
+ 
+-            if ((ch < 'A' || ch > 'Z') && ch != '_' && ch != '-') {
++            if (ch == '0') {
++                // httpg with no delegation
++                // eat the character and continue with the rest of the request
++                ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "httpg request w/o delegation");
++                r->request_start++;
++                // httpg with a delegation request would fail for an unknown method
++            } else if ((ch < 'A' || ch > 'Z') && ch != '_' && ch != '-') {
+                 return NGX_HTTP_PARSE_INVALID_METHOD;
+             }
+ 
-- 
GitLab