summaryrefslogtreecommitdiff
path: root/content
diff options
context:
space:
mode:
Diffstat (limited to 'content')
-rw-r--r--content/fetchcache.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/content/fetchcache.c b/content/fetchcache.c
index 3c43e1f60..a763db193 100644
--- a/content/fetchcache.c
+++ b/content/fetchcache.c
@@ -1147,8 +1147,12 @@ void fetchcache_auth(struct content *c, const char *realm)
char *headers = NULL;
/* Preconditions */
- assert(c && realm);
+ assert(c);
assert(c->status == CONTENT_STATUS_TYPE_UNKNOWN);
+ /* Realm may be NULL iff there was no WWW-Authenticate header
+ * Use the content's URL as the realm in this case */
+ if (realm == NULL)
+ realm = c->url;
/* Extract fetch details */
ref = fetch_get_referer(c->fetch);
@@ -1179,7 +1183,7 @@ void fetchcache_auth(struct content *c, const char *realm)
if (auth == NULL || c->tried_with_auth) {
/* No authentication details or we tried what we had, so ask
* our client for them. */
- c->tried_with_auth = false; /* Allow rety. */
+ c->tried_with_auth = false; /* Allow retry. */
c->status = CONTENT_STATUS_ERROR;
msg_data.auth_realm = realm;