@@ -471,7 +471,7 @@ ngx_http_modsecurity_header_filter(ngx_http_request_t *r)
471471     */ 
472472    for  (i  =  0 ; ngx_http_modsecurity_headers_out [i ].name .len ; i ++ )
473473    {
474-         dd ("  Sending header to ModSecurity - header: `%.*s'. " ,
474+         dd ("Sending header to ModSecurity - header: `%.*s'" ,
475475            (int ) ngx_http_modsecurity_headers_out [i ].name .len ,
476476            ngx_http_modsecurity_headers_out [i ].name .data );
477477
@@ -516,14 +516,24 @@ ngx_http_modsecurity_header_filter(ngx_http_request_t *r)
516516
517517    /* 
518518     * NGINX always sends HTTP response with HTTP/1.1, except cases when 
519-      * HTTP V2 module is enabled, and request has been posted with HTTP/2.0. 
519+      * HTTP V2 module is enabled, and request has been posted with HTTP/2.0 
520+      * or when using HTTP V3 
520521     */ 
521-     http_response_ver  =  "HTTP 1.1" ;
522- #if  (NGX_HTTP_V2 )
523-     if  (r -> stream ) {
524-         http_response_ver  =  "HTTP 2.0" ;
525-     }
522+     switch  (r -> http_version ) {
523+ #ifdef  NGX_HTTP_VERSION_30 
524+         case  NGX_HTTP_VERSION_30  :
525+             http_response_ver  =  "HTTP 3.0" ;
526+             break ;
527+ #endif 
528+ #ifdef  NGX_HTTP_VERSION_20 
529+         case  NGX_HTTP_VERSION_30  :
530+             http_response_ver  =  "HTTP 2.0" ;
531+             break ;
526532#endif 
533+         default :
534+             http_response_ver  =  "HTTP 1.1" ;
535+             break ;
536+     }
527537
528538    old_pool  =  ngx_http_modsecurity_pcre_malloc_init (r -> pool );
529539    msc_process_response_headers (ctx -> modsec_transaction , status , http_response_ver );
0 commit comments