1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-12 23:10:51 +00: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:
Miciah Dashiel Butler Masters 2007-09-04 12:05:55 +00:00 committed by Miciah Dashiel Butler Masters
parent 34c9389e9b
commit 2d0180d1e7
3 changed files with 18 additions and 1 deletions

View File

@ -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
View 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
View 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>