Skip to content

Commit 1c45440

Browse files
authored
Merge pull request #225 from martinhsv/master
Support http protocol versions besides 0.9, 1.0, 1.1, 2.0
2 parents 1c32794 + 755011c commit 1c45440

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Diff for: CHANGES

+2
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
- Support for building with nginx configured with PCRE2
57
[Issue #260 - @defanator]
68

Diff for: src/ngx_http_modsecurity_rewrite.c

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

0 commit comments

Comments
 (0)