aboutsummaryrefslogblamecommitdiffstats
path: root/testing/nginx-naxsi/anonymise.patch
blob: 8b6f9c2ba1454885e9446b652c35d7edeeff6345 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12


                                                              


   





                                                                                


                                             
                     

                                         


                                                                
 








                                                                          









                                           







                                                





                                      


                                                             

                                                                  











                                                                          

      
                                       
--- nginx-1.11.10/src/http/ngx_http_header_filter_module.c
+++ nginx-1.11.10/src/http/ngx_http_header_filter_module.c.new
@@ -46,9 +46,9 @@
 };
 
 
-static u_char ngx_http_server_string[] = "Server: nginx" 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[] = "";
+static u_char ngx_http_server_full_string[] = "";
+static u_char ngx_http_server_build_string[] = "";
 
 
 static ngx_str_t ngx_http_status_lines[] = {
@@ -276,10 +276,10 @@
 
     if (r->headers_out.server == NULL) {
         if (clcf->server_tokens == NGX_HTTP_SERVER_TOKENS_ON) {
-            len += sizeof(ngx_http_server_full_string) - 1;
+            len += sizeof(ngx_http_server_full_string) - 0;
 
         } else if (clcf->server_tokens == NGX_HTTP_SERVER_TOKENS_BUILD) {
-            len += sizeof(ngx_http_server_build_string) - 1;
+            len += sizeof(ngx_http_server_build_string) - 0;
 
         } else {
             len += sizeof(ngx_http_server_string) - 1;
--- nginx-1.11.10/src/http/ngx_http_special_response.c
+++ nginx-1.11.10/src/http/ngx_http_special_response.c.new
@@ -19,21 +19,21 @@
 
 
 static u_char ngx_http_error_full_tail[] =
-"<hr><center>" NGINX_VER "</center>" CRLF
+"<hr><center>127.0.0.1</center>" CRLF
 "</body>" CRLF
 "</html>" CRLF
 ;
 
 
 static u_char ngx_http_error_build_tail[] =
-"<hr><center>" NGINX_VER_BUILD "</center>" CRLF
+"<hr><center>1.0.0</center>" CRLF
 "</body>" CRLF
 "</html>" CRLF
 ;
 
 
 static u_char ngx_http_error_tail[] =
-"<hr><center>nginx</center>" CRLF
+"<hr><center>localhost</center>" CRLF
 "</body>" CRLF
 "</html>" CRLF
 ;
--- nginx-1.11.10/src/http/v2/ngx_http_v2_filter_module.c
+++ nginx-1.11.10/src/http/v2/ngx_http_v2_filter_module.c.new
@@ -236,16 +236,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 += 1 + nginx_ver_len;
-
-        } else if (clcf->server_tokens == NGX_HTTP_SERVER_TOKENS_BUILD) {
-            len += 1 + nginx_ver_build_len;
-
-        } else {
-            len += 1 + sizeof(nginx);
-        }
+	len += 1 + sizeof(nginx);
     }
 
     if (r->headers_out.date == NULL) {