mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -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
34c9389e9b
commit
2d0180d1e7
@ -302,7 +302,7 @@ process_head(struct html_context *html_context, unsigned char *head)
|
||||
unsigned char *refresh, *url;
|
||||
|
||||
refresh = parse_header(head, "Refresh", NULL);
|
||||
if (!refresh) return;
|
||||
if (refresh) {
|
||||
|
||||
parse_header_param(refresh, "URL", &url);
|
||||
if (!url) {
|
||||
@ -359,6 +359,7 @@ process_head(struct html_context *html_context, unsigned char *head)
|
||||
}
|
||||
|
||||
mem_free(refresh);
|
||||
}
|
||||
|
||||
if (!get_opt_bool("document.cache.ignore_cache_control", NULL)) {
|
||||
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