Commit 1eb59940 authored by Sergey Lyubka's avatar Sergey Lyubka

Re-init rewrites var in convert_uri_to_file_name()

parent 576d769b
......@@ -2233,6 +2233,7 @@ static int convert_uri_to_file_name(struct connection *conn, char *buf,
// Handle URL rewrites
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) {
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment