+ exports = map(exports, "force-prefix", 1, FORCE_PREFIX, 1);
+#else
+ exports = map_block_killer(exports, "force-support");
+#endif /* ndef FORCE_LOAD */
+
+ exports = map(exports, "hostport", 1, csp->http->hostport, 1);
+ exports = map(exports, "hostport-html", 1, html_encode(csp->http->hostport), 0);
+ exports = map(exports, "path", 1, csp->http->path, 1);
+ exports = map(exports, "path-html", 1, html_encode(csp->http->path), 0);
+
+ rsp->body = fill_template(csp, "blocked", exports);
+ free_map(exports);
+
+ rsp->status = strdup("403 Request for blocked URL");
+ }
+
+ return(finish_http_response(rsp));
+
+}
+
+
+#ifdef TRUST_FILES
+/*********************************************************************
+ *
+ * Function : trust_url FIXME: I should be called distrust_url
+ *
+ * Description : Calls is_untrusted_url to determine if the URL is trusted
+ * and if not, returns a HTTP 304 response with a reject message.
+ *
+ * Parameters :
+ * 1 : csp = Current client state (buffers, headers, etc...)
+ *
+ * Returns : NULL => trusted, else http_response.
+ *
+ *********************************************************************/
+struct http_response *trust_url(struct client_state *csp)
+{
+ struct http_response *rsp;
+ struct map *exports = NULL;
+ char buf[BUFFER_SIZE], *p = NULL;
+ struct url_spec **tl, *t;
+
+ /*
+ * Don't bother to work on trusted URLs
+ */
+ if (!is_untrusted_url(csp))
+ {
+ return NULL;
+ }
+
+ /*
+ * Else, prepare a response:
+ */
+ if (NULL == ( rsp = (struct http_response *)zalloc(sizeof(*rsp))))
+ {
+ return NULL;
+ }
+ exports = default_exports(csp, NULL);
+
+ /*
+ * Export the host, port, and referrer information
+ */
+ exports = map(exports, "hostport", 1, csp->http->hostport, 1);
+ exports = map(exports, "path", 1, csp->http->path, 1);
+ exports = map(exports, "hostport-html", 1, html_encode(csp->http->hostport), 0);
+ exports = map(exports, "path-html", 1, html_encode(csp->http->path), 0);
+
+ if (csp->referrer && strlen(csp->referrer) > 9)
+ {
+ exports = map(exports, "referrer", 1, csp->referrer + 9, 1);
+ exports = map(exports, "referrer-html", 1, html_encode(csp->referrer + 9), 0);
+ }
+ else
+ {
+ exports = map(exports, "referrer", 1, "unknown", 1);
+ exports = map(exports, "referrer-html", 1, "unknown", 1);
+ }