mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
Fix process_head to check for cache-control information even if no refresh
Previously, process_head immediately returned if there was no refresh, never giving the cache-control check further down a chance to run. Also add new tests: nocache.html refresh+nocache.html
This commit is contained in:
parent
5b28e89026
commit
23262b3145
@ -383,7 +383,7 @@ process_head(struct html_context *html_context, unsigned char *head)
|
|||||||
unsigned char *refresh, *url;
|
unsigned char *refresh, *url;
|
||||||
|
|
||||||
refresh = parse_header(head, "Refresh", NULL);
|
refresh = parse_header(head, "Refresh", NULL);
|
||||||
if (!refresh) return;
|
if (refresh) {
|
||||||
|
|
||||||
search_for_url_param(refresh, &url);
|
search_for_url_param(refresh, &url);
|
||||||
if (!url) {
|
if (!url) {
|
||||||
@ -440,6 +440,7 @@ process_head(struct html_context *html_context, unsigned char *head)
|
|||||||
}
|
}
|
||||||
|
|
||||||
mem_free(refresh);
|
mem_free(refresh);
|
||||||
|
}
|
||||||
|
|
||||||
if (!get_opt_bool("document.cache.ignore_cache_control")) {
|
if (!get_opt_bool("document.cache.ignore_cache_control")) {
|
||||||
unsigned char *d;
|
unsigned char *d;
|
||||||
|
6
test/nocache.html
Normal file
6
test/nocache.html
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<html>
|
||||||
|
<head><meta http-equiv="cache-control" content="no-cache" /></head>
|
||||||
|
<body>
|
||||||
|
<p>This document should not be cached.</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
10
test/refresh+nocache.html
Normal file
10
test/refresh+nocache.html
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="refresh" content="3" />
|
||||||
|
<meta http-equiv="cache-control" content="no-cache" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>Reload after 3 seconds.</p>
|
||||||
|
<p>This document should not be cached.</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue
Block a user