Update http_server.c

This commit is contained in:
Dany LE 2022-08-21 17:01:34 +02:00 committed by GitHub
parent 7bf58c1d01
commit 8cab868003
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -562,6 +562,7 @@ int rule_check(const char *k, const char *v, const char *host, const char *_url,
char *tmp, rep[10];
int idx = 0;
memset(rep, 0, 10);
LOG("Verify %s on %s or %s", k, url, host);
// 1 group
if (!host || !(ret = regex_match(k, host, 10, key_matches)))
{
@ -577,6 +578,7 @@ int rule_check(const char *k, const char *v, const char *host, const char *_url,
free(query);
return 0;
}
LOG("Match found on", target);
tmp = (char *)v;
char *search = "<([a-zA-Z0-9]+)>";
while ((ret = regex_match(search, tmp, 2, val_matches)))
@ -621,6 +623,7 @@ int rule_check(const char *k, const char *v, const char *host, const char *_url,
}
free(url);
free(query);
LOG("New URI is %s", buf);
return 1;
}