diff options
author | defanor <defanor@uberspace.net> | 2017-12-06 10:18:54 +0300 |
---|---|---|
committer | defanor <defanor@uberspace.net> | 2017-12-06 10:18:54 +0300 |
commit | d09155bcb8ce047d33ce97c34ae0c972281fe99d (patch) | |
tree | 0f825bdda1a975cfc81930294cc302f1ab1924d2 /Pancake/Reading.hs | |
parent | b075319adfe2b12fe81c5a4f8c5257e99e649a54 (diff) |
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.
Diffstat (limited to 'Pancake/Reading.hs')
-rw-r--r-- | Pancake/Reading.hs | 4 |
1 files changed, 3 insertions, 1 deletions
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) |