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:
parent
b2b0aa9afe
commit
0976d12b88
4
net_io.c
4
net_io.c
|
@ -866,6 +866,10 @@ int handleHTTPRequest(struct client *c, char *p) {
|
||||||
printf("HTTP requested URL: %s\n\n", url);
|
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;
|
statuscode = 404;
|
||||||
for (i = 0; url_handlers[i].path; ++i) {
|
for (i = 0; url_handlers[i].path; ++i) {
|
||||||
if (!strcmp(url, url_handlers[i].path)) {
|
if (!strcmp(url, url_handlers[i].path)) {
|
||||||
|
|
Loading…
Reference in a new issue