Skip to content

Commit 7b8d7de

Browse files
committed
Support http protocol versions besides 0.9, 1.0, 1.1, 2.0
1 parent 22e53ab commit 7b8d7de

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

CHANGES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
v1.0.x - YYYY-MMM-DD (To be released)
22
-------------------------------------
33

4+
- Support http protocol versions besides 0.9, 1.0, 1.1, 2.0
5+
[Issue #224 - @HQuest, @martinhsv]
46
- Fix nginx not clearing body cache (caused by incomplete fix for #187)
57
[Issue #216 - @krewi1, @martinhsv]
68
- Fix config setting not respected: client_body_in_file_only on

src/ngx_http_modsecurity_rewrite.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,15 @@ ngx_http_modsecurity_rewrite_handler(ngx_http_request_t *r)
137137
break;
138138
#endif
139139
default :
140-
http_version = "1.0";
140+
http_version = ngx_str_to_char(r->http_protocol, r->pool);
141+
if (http_version == (char*)-1) {
142+
return NGX_HTTP_INTERNAL_SERVER_ERROR;
143+
}
144+
if ((http_version != NULL) && (strlen(http_version) > 5) && (!strncmp("HTTP/", http_version, 5))) {
145+
http_version += 5;
146+
} else {
147+
http_version = "1.0";
148+
}
141149
break;
142150
}
143151

0 commit comments

Comments
 (0)