From c6528ea4851596f4255cd6550bbd02c383a50ac5 Mon Sep 17 00:00:00 2001 From: wessels <> Date: Sun, 7 Dec 1997 12:33:04 +0000 Subject: [PATCH] fix uri-res/N2L usage to be full URN --- src/urn.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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"); -- 2.47.3