Skip to content

Commit 10ac540

Browse files
author
Liu Dongmiao
committed
don't assume method name is always uppercase
1 parent 7b83991 commit 10ac540

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/ngx_http_modsecurity_rewrite.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,13 @@ ngx_http_modsecurity_rewrite_handler(ngx_http_request_t *r)
146146
const char *n_method = ngx_str_to_char(r->request_line, r->pool);
147147
if (n_method != NULL && n_method != (char *)-1) {
148148
char *p = (char *) n_method;
149-
while (*p >= 'A' && *p <= 'Z') {
149+
while (*p) {
150+
if (*p == ' ') {
151+
*p = '\0';
152+
break;
153+
}
150154
p++;
151155
}
152-
if (*p) {
153-
*p = '\0';
154-
}
155156
}
156157
if (n_uri == (char*)-1 || n_method == (char*)-1) {
157158
return NGX_HTTP_INTERNAL_SERVER_ERROR;

0 commit comments

Comments
 (0)