From d09155bcb8ce047d33ce97c34ae0c972281fe99d Mon Sep 17 00:00:00 2001 From: defanor Date: Wed, 6 Dec 2017 10:18:54 +0300 Subject: Add a web.archive.org shortcut into the default configuration Finding the last HTTP 200 response via the availability API, so a dummy "web-archive" scheme is added into the default configuration in order to use a custom command. The URI_ESCAPED environment variable is also introduced, though not used here -- but may be handy for similar custom commands. --- Pancake/Reading.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Pancake/Reading.hs') diff --git a/Pancake/Reading.hs b/Pancake/Reading.hs index 0aa27f3..cdb4093 100644 --- a/Pancake/Reading.hs +++ b/Pancake/Reading.hs @@ -93,7 +93,9 @@ retrieve cmd uri = do , ("URI_REGNAME", uriRegName x) , ("URI_PORT", uriPort x) ]) (uriAuthority uri) - environment = ("URI", uriToString id uri "") + uriStr = uriToString id uri "" + environment = ("URI", uriStr) + : ("URI_ESCAPED", escapeURIString isUnreserved uriStr) : ("URI_SCHEME", uriScheme uri) : ("URI_PATH", uriPath uri) : ("URI_QUERY", uriQuery uri) -- cgit v1.2.3