From: wessels <> Date: Sun, 7 Dec 1997 12:33:04 +0000 (+0000) Subject: fix uri-res/N2L usage to be full URN X-Git-Tag: SQUID_3_0_PRE1~4368 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c6528ea4851596f4255cd6550bbd02c383a50ac5;p=thirdparty%2Fsquid.git fix uri-res/N2L usage to be full URN --- diff --git a/src/urn.cc b/src/urn.cc index eb42265dc6..fec6a35c02 100644 --- a/src/urn.cc +++ b/src/urn.cc @@ -85,6 +85,7 @@ urnStart(request_t *r, StoreEntry *e) request_t *urlres_r = NULL; const cache_key *k; char *t; + char *host; UrnState *urnState; StoreEntry *urlres_e; debug(50, 3) ("urnStart: '%s'\n", storeUrl(e)); @@ -97,12 +98,15 @@ urnStart(request_t *r, StoreEntry *e) return; } *t = '\0'; + host = xstrdup(r->urlpath); + *t = ':'; urnState = xcalloc(1, sizeof(UrnState)); urnState->entry = e; urnState->request = requestLink(r); cbdataAdd(urnState); storeLockObject(urnState->entry); - snprintf(urlres, 4096, "http://%s/uri-res/N2L?%s", r->urlpath, t+1); + snprintf(urlres, 4096, "http://%s/uri-res/N2L?urn:%s", host, r->urlpath); + safe_free(host); k = storeKeyPublic(urlres, METHOD_GET); urlres_r = urlParse(METHOD_GET, urlres); urlres_r->headers = xstrdup("Accept: text/plain\r\n\r\n");