diff --git a/src/Application.hs b/src/Application.hs index ef53de4..fef719f 100644 --- a/src/Application.hs +++ b/src/Application.hs @@ -42,9 +42,10 @@ app runner = do Nothing -> respond notFound post "/short" $ do - (form, _) <- parseForm - case BS.unpack <$> lookup "url" form of - Just url -> do + form <- fmap fst parseForm + case lookup "url" form of + Just url' -> do + let url = BS.unpack url' name <- liftIO (insert table url) logStr (printf "Registered %s -> %s " url name) render done $ object ["link" .= (bindUrl ++ name)]