Ditch any query strings in HTTP requests before handling them,

to allow AJAX requests to tack on a query string to avoid caching.
This commit is contained in:
Oliver Jowett 2015-01-07 18:40:55 +00:00
parent b2b0aa9afe
commit 0976d12b88

View file

@ -866,6 +866,10 @@ int handleHTTPRequest(struct client *c, char *p) {
printf("HTTP requested URL: %s\n\n", url);
}
// Ditch any trailing query part (AJAX might add one to avoid caching)
p = strchr(url, '?');
if (p) *p = 0;
statuscode = 404;
for (i = 0; url_handlers[i].path; ++i) {
if (!strcmp(url, url_handlers[i].path)) {