1
0
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:
Miciah Dashiel Butler Masters 2007-09-04 12:05:55 +00:00 committed by Laurent MONIN
parent 5b28e89026
commit 23262b3145
3 changed files with 18 additions and 1 deletions

View File

@ -383,7 +383,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) {
search_for_url_param(refresh, &url);
if (!url) {
@ -440,6 +440,7 @@ process_head(struct html_context *html_context, unsigned char *head)
}
mem_free(refresh);
}
if (!get_opt_bool("document.cache.ignore_cache_control")) {
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>