diff options
Diffstat (limited to 'Utility')
-rw-r--r-- | Utility/Format.hs | 2 | ||||
-rw-r--r-- | Utility/Url.hs | 17 |
2 files changed, 9 insertions, 10 deletions
diff --git a/Utility/Format.hs b/Utility/Format.hs index 79e94ae96..1d96695ed 100644 --- a/Utility/Format.hs +++ b/Utility/Format.hs @@ -94,7 +94,7 @@ gen = filter (not . empty) . fuse [] . scan [] . decode_c | i < 0 = LeftJustified (-1 * i) | otherwise = RightJustified i novar v = "${" ++ reverse v - foundvar f v p cs = scan (Var (reverse v) p : f) cs + foundvar f v p = scan (Var (reverse v) p : f) empty :: Frag -> Bool empty (Const "") = True diff --git a/Utility/Url.hs b/Utility/Url.hs index dfdebaf06..8a43cf788 100644 --- a/Utility/Url.hs +++ b/Utility/Url.hs @@ -108,12 +108,11 @@ request url requesttype = go 5 url (3,0,x) | x /= 5 -> redir (n - 1) u rsp _ -> return rsp ignore = const $ return () - redir n u rsp = do - case retrieveHeaders HdrLocation rsp of - [] -> return rsp - (Header _ newu:_) -> - case parseURIReference newu of - Nothing -> return rsp - Just newURI -> go n newURI_abs - where - newURI_abs = fromMaybe newURI (newURI `relativeTo` u) + redir n u rsp = case retrieveHeaders HdrLocation rsp of + [] -> return rsp + (Header _ newu:_) -> + case parseURIReference newu of + Nothing -> return rsp + Just newURI -> go n newURI_abs + where + newURI_abs = fromMaybe newURI (newURI `relativeTo` u) |