|
|
|
@ -355,11 +355,14 @@ static void ICACHE_FLASH_ATTR httpdProcessRequest(HttpdConnData *conn) { |
|
|
|
|
if (conn->cgi == NULL) { |
|
|
|
|
while (builtInUrls[i].url != NULL) { |
|
|
|
|
int match = 0; |
|
|
|
|
int urlLen = os_strlen(builtInUrls[i].url); |
|
|
|
|
//See if there's a literal match
|
|
|
|
|
if (os_strcmp(builtInUrls[i].url, conn->url) == 0) match = 1; |
|
|
|
|
//See if there's a wildcard match
|
|
|
|
|
if (builtInUrls[i].url[os_strlen(builtInUrls[i].url) - 1] == '*' && |
|
|
|
|
os_strncmp(builtInUrls[i].url, conn->url, os_strlen(builtInUrls[i].url) - 1) == 0) match = 1; |
|
|
|
|
if (builtInUrls[i].url[urlLen - 1] == '*' && |
|
|
|
|
os_strncmp(builtInUrls[i].url, conn->url, urlLen - 1) == 0) match = 1; |
|
|
|
|
else if (builtInUrls[i].url[0] == '*' && ( strlen(conn->url) >= urlLen -1 ) && |
|
|
|
|
os_strncmp(builtInUrls[i].url + 1, conn->url + strlen(conn->url) - urlLen + 1, urlLen - 1) == 0) match = 1; |
|
|
|
|
if (match) { |
|
|
|
|
//os_printf("Is url index %d\n", i);
|
|
|
|
|
conn->cgiData = NULL; |
|
|
|
|