File: redirect.hs

package info (click to toggle)
haskell-cgi 3001.5.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 184 kB
  • sloc: haskell: 818; makefile: 6
file content (11 lines) | stat: -rw-r--r-- 309 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
-- Redirect to the URL given by the url parameter.

import Network.CGI (MonadCGI, CGIResult, runCGI, getInput, output, redirect)

redirectToURL :: MonadCGI m => m CGIResult
redirectToURL =
    getInput "url" >>= maybe (output "url parameter not set!\n") redirect

main :: IO ()
main =
   runCGI redirectToURL