Skip to content
Snippets Groups Projects
Commit 1eb59940 authored by Sergey Lyubka's avatar Sergey Lyubka
Browse files

Re-init rewrites var in convert_uri_to_file_name()

parent 576d769b
No related branches found
No related tags found
No related merge requests found
...@@ -2233,6 +2233,7 @@ static int convert_uri_to_file_name(struct connection *conn, char *buf, ...@@ -2233,6 +2233,7 @@ static int convert_uri_to_file_name(struct connection *conn, char *buf,
// Handle URL rewrites // Handle URL rewrites
mg_snprintf(buf, buf_len, "%.*s%s", root_len, root, uri); mg_snprintf(buf, buf_len, "%.*s%s", root_len, root, uri);
rewrites = conn->server->config_options[URL_REWRITES]; // Re-initialize!
while ((rewrites = next_option(rewrites, &a, &b)) != NULL) { while ((rewrites = next_option(rewrites, &a, &b)) != NULL) {
if ((match_len = match_prefix(a.ptr, a.len, uri)) > 0) { if ((match_len = match_prefix(a.ptr, a.len, uri)) > 0) {
mg_snprintf(buf, buf_len, "%.*s%s", (int) b.len, b.ptr, uri + match_len); mg_snprintf(buf, buf_len, "%.*s%s", (int) b.len, b.ptr, uri + match_len);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment