lookup package:snap-core

Look up the value of a given HTTP header field. Example:
ghci> :set -XOverloadedStrings
ghci> H.lookup "host" $ H.fromList [("Host", "localhost")]
Just "localhost"
ghci> H.lookup "Accept" $ H.fromList [("Host", "localhost")]
Nothing
Look up the value of a given HTTP header field or return the provided default value when that header field is not present. Example:
ghci> :set -XOverloadedStrings
ghci> let hdrs = H.fromList [("Host", "localhost")]
ghci> H.lookupWithDefault "host" "127.0.0.1" $ hdrs
"localhost"
ghci> H.lookupWithDefault "Accept" "text/plain" $ hdrs
"text/plain"