Skip to content

Commit

Permalink
add patches for freenginx
Browse files Browse the repository at this point in the history
  • Loading branch information
torden committed Jun 26, 2024
1 parent 2aeeb46 commit 5e9035d
Show file tree
Hide file tree
Showing 4 changed files with 172 additions and 0 deletions.
51 changes: 51 additions & 0 deletions freenginx-1.27.x-ngx_http_header_filter_module.c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
--- src/http/ngx_http_header_filter_module.c 2024-06-26 14:34:05.775860781 +0900
+++ src/http/ngx_http_header_filter_module.c.new 2024-06-04 22:55:54.000000000 +0900
@@ -46,9 +46,9 @@
};


+//static u_char ngx_http_server_string[] = "Server: " NGINX_NAME CRLF;
+//static u_char ngx_http_server_full_string[] = "Server: " NGINX_VER CRLF;
+//static u_char ngx_http_server_build_string[] = "Server: " NGINX_VER_BUILD CRLF;
-static u_char ngx_http_server_string[] = "Server: " NGINX_NAME CRLF;
-static u_char ngx_http_server_full_string[] = "Server: " NGINX_VER CRLF;
-static u_char ngx_http_server_build_string[] = "Server: " NGINX_VER_BUILD CRLF;


static ngx_str_t ngx_http_status_lines[] = {
@@ -282,7 +282,7 @@
}

clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
+/*
-
if (r->headers_out.server == NULL) {
if (clcf->server_tokens == NGX_HTTP_SERVER_TOKENS_ON) {
len += sizeof(ngx_http_server_full_string) - 1;
@@ -294,7 +294,7 @@
len += sizeof(ngx_http_server_string) - 1;
}
}
+*/
-
if (r->headers_out.date == NULL) {
len += sizeof("Date: Mon, 28 Sep 1970 06:00:00 GMT" CRLF) - 1;
}
@@ -451,7 +451,7 @@
b->last = ngx_sprintf(b->last, "%03ui ", status);
}
*b->last++ = CR; *b->last++ = LF;
+/*
-
if (r->headers_out.server == NULL) {
if (clcf->server_tokens == NGX_HTTP_SERVER_TOKENS_ON) {
p = ngx_http_server_full_string;
@@ -468,7 +468,7 @@

b->last = ngx_cpymem(b->last, p, len);
}
+*/
-
if (r->headers_out.date == NULL) {
b->last = ngx_cpymem(b->last, "Date: ", sizeof("Date: ") - 1);
b->last = ngx_cpymem(b->last, ngx_cached_http_time.data,
27 changes: 27 additions & 0 deletions freenginx-1.27.x-ngx_http_special_response.c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
--- src/http/ngx_http_special_response.c 2024-06-04 22:55:54.000000000 +0900
+++ src/http/ngx_http_special_response.c.new 2024-06-26 14:36:07.259654964 +0900
@@ -19,21 +19,21 @@


static u_char ngx_http_error_full_tail[] =
-"<hr><center>" NGINX_VER "</center>" CRLF
+//"<hr><center>" NGINX_VER "</center>" CRLF
"</body>" CRLF
"</html>" CRLF
;


static u_char ngx_http_error_build_tail[] =
-"<hr><center>" NGINX_VER_BUILD "</center>" CRLF
+//"<hr><center>" NGINX_VER_BUILD "</center>" CRLF
"</body>" CRLF
"</html>" CRLF
;


static u_char ngx_http_error_tail[] =
-"<hr><center>" NGINX_NAME "</center>" CRLF
+//"<hr><center>" NGINX_NAME "</center>" CRLF
"</body>" CRLF
"</html>" CRLF
;
56 changes: 56 additions & 0 deletions freenginx-1.27.x-ngx_http_v2_filter_module.c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
--- src/http/v2/ngx_http_v2_filter_module.c 2024-06-26 14:39:43.707374158 +0900
+++ src/http/v2/ngx_http_v2_filter_module.c.new 2024-06-04 22:55:54.000000000 +0900
@@ -119,7 +119,7 @@
static const u_char accept_encoding[12] =
"\x8b\x84\x84\x2d\x69\x5b\x05\x44\x3c\x86\xaa\x6f";
#endif
+/*
-
static size_t nginx_name_len = ngx_http_v2_literal_size(NGINX_NAME);
static u_char nginx_name[ngx_http_v2_literal_size(NGINX_NAME)];

@@ -129,7 +129,7 @@
static size_t nginx_ver_build_len =
ngx_http_v2_literal_size(NGINX_VER_BUILD);
static u_char nginx_ver_build[ngx_http_v2_literal_size(NGINX_VER_BUILD)];
+*/
-
stream = r->stream;

if (!stream) {
@@ -218,7 +218,7 @@
len += status ? 1 : 1 + ngx_http_v2_literal_size("418");

clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
+/*
-
if (r->headers_out.server == NULL) {

if (clcf->server_tokens == NGX_HTTP_SERVER_TOKENS_ON) {
@@ -231,7 +231,7 @@
len += 1 + nginx_name_len;
}
}
+*/
-
if (r->headers_out.date == NULL) {
len += 1 + ngx_http_v2_literal_size("Wed, 31 Dec 1986 18:00:00 GMT");
}
@@ -422,7 +422,7 @@
*pos++ = NGX_HTTP_V2_ENCODE_RAW | 3;
pos = ngx_sprintf(pos, "%03ui", r->headers_out.status);
}
+/*
-
if (r->headers_out.server == NULL) {

if (clcf->server_tokens == NGX_HTTP_SERVER_TOKENS_ON) {
@@ -472,7 +472,7 @@
pos = ngx_cpymem(pos, nginx_name, nginx_name_len);
}
}
+*/
-
if (r->headers_out.date == NULL) {
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, fc->log, 0,
"http2 output header: \"date: %V\"",
38 changes: 38 additions & 0 deletions freenginx-1.27.x-ngx_http_v3_filter_module.c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
--- src/http/v3/ngx_http_v3_filter_module.c 2024-06-26 14:41:00.415272870 +0900
+++ src/http/v3/ngx_http_v3_filter_module.c.new 2024-06-04 22:55:54.000000000 +0900
@@ -157,7 +157,7 @@
}

clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
+/*
-
if (r->headers_out.server == NULL) {
if (clcf->server_tokens == NGX_HTTP_SERVER_TOKENS_ON) {
n = sizeof(NGINX_VER) - 1;
@@ -173,7 +173,7 @@
NGX_HTTP_V3_HEADER_SERVER,
NULL, n);
}
+*/
-
if (r->headers_out.date == NULL) {
len += ngx_http_v3_encode_field_lri(NULL, 0, NGX_HTTP_V3_HEADER_DATE,
NULL, ngx_cached_http_time.len);
@@ -338,7 +338,7 @@
NULL, 3);
b->last = ngx_sprintf(b->last, "%03ui", r->headers_out.status);
}
+/*
-
if (r->headers_out.server == NULL) {
if (clcf->server_tokens == NGX_HTTP_SERVER_TOKENS_ON) {
p = (u_char *) NGINX_VER;
@@ -360,7 +360,7 @@
NGX_HTTP_V3_HEADER_SERVER,
p, n);
}
+*/
-
if (r->headers_out.date == NULL) {
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
"http3 output header: \"date: %V\"",

0 comments on commit 5e9035d

Please sign in to comment.