uword *p, *url_table;
int rv;
- if (!hsm->enable_url_handlers)
+ if (!hsm->enable_url_handlers || !request)
return -1;
/* Look for built-in GET / POST handlers */
* Construct the file to open
* Browsers are capable of sporadically including a leading '/'
*/
- if (request[0] == '/')
+ if (!request)
+ path = format (0, "%s%c", hsm->www_root, 0);
+ else if (request[0] == '/')
path = format (0, "%s%s%c", hsm->www_root, request, 0);
else
path = format (0, "%s/%s%c", hsm->www_root, request, 0);