From 2d0180d1e7822a80b1cdbe99259c8867fac96c40 Mon Sep 17 00:00:00 2001 From: Miciah Dashiel Butler Masters Date: Tue, 4 Sep 2007 12:05:55 +0000 Subject: [PATCH] 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 --- src/document/html/parser.c | 3 ++- test/nocache.html | 6 ++++++ test/refresh+nocache.html | 10 ++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 test/nocache.html create mode 100644 test/refresh+nocache.html diff --git a/src/document/html/parser.c b/src/document/html/parser.c index 3cfdb7bf..c1e31bd7 100644 --- a/src/document/html/parser.c +++ b/src/document/html/parser.c @@ -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; diff --git a/test/nocache.html b/test/nocache.html new file mode 100644 index 00000000..cfaea961 --- /dev/null +++ b/test/nocache.html @@ -0,0 +1,6 @@ + + + +

This document should not be cached.

+ + diff --git a/test/refresh+nocache.html b/test/refresh+nocache.html new file mode 100644 index 00000000..13b8c6ee --- /dev/null +++ b/test/refresh+nocache.html @@ -0,0 +1,10 @@ + + + + + + +

Reload after 3 seconds.

+

This document should not be cached.

+ +