summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-11-18 20:37:46 +0100
committerdefault <nobody@localhost>2022-11-18 20:37:46 +0100
commit29a83fa1d2737cee2964953f8e9055911115eb5f (patch)
treee9f9ccfef4479500112d0d7988174a748a00534d
parent0644518fd5d8aa1124af904c08e2c92bc45c499d (diff)
Fixed crash when testing for the Accept header.
-rw-r--r--html.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/html.c b/html.c
index c5e9643..0db6856 100644
--- a/html.c
+++ b/html.c
@@ -984,9 +984,11 @@ int html_get_handler(d_char *req, char *q_path, char **body, int *b_size, char *
}
/* return the RSS if requested by Accept header */
- if (xs_str_in(accept, "text/xml") != -1 ||
- xs_str_in(accept, "application/rss+xml") != -1)
- p_path = ".rss";
+ if (accept != NULL) {
+ if (xs_str_in(accept, "text/xml") != -1 ||
+ xs_str_in(accept, "application/rss+xml") != -1)
+ p_path = ".rss";
+ }
/* check if server config variable 'disable_cache' is set */
if ((v = xs_dict_get(srv_config, "disable_cache")) && xs_type(v) == XSTYPE_TRUE)