We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2497e6a commit 2019155Copy full SHA for 2019155
src/ngx_http_modsecurity_rewrite.c
@@ -143,7 +143,17 @@ ngx_http_modsecurity_rewrite_handler(ngx_http_request_t *r)
143
}
144
145
const char *n_uri = ngx_str_to_char(r->unparsed_uri, r->pool);
146
- const char *n_method = ngx_str_to_char(r->method_name, r->pool);
+ const char *n_method = ngx_str_to_char(r->request_line, r->pool);
147
+ if (n_method != NULL && n_method != (char *)-1) {
148
+ char *p = (char *) n_method;
149
+ while (*p) {
150
+ if (*p == ' ') {
151
+ *p = '\0';
152
+ break;
153
+ }
154
+ p++;
155
156
157
if (n_uri == (char*)-1 || n_method == (char*)-1) {
158
return NGX_HTTP_INTERNAL_SERVER_ERROR;
159
0 commit comments