convertMethod :: W.Method -> H.Method
convertMethod m =
    -- TODO: somehow return 'Bad Request' response
    -- instead of expecting the application host to
    -- catch errors.
    case W.parseMethod m of
      Left{} -> error $ "Unknown method " ++ (show . B8.unpack) m
      Right stdM ->
          case stdM of
            W.GET -> H.GET
            W.POST -> H.POST
            W.HEAD -> H.HEAD
            W.PUT -> H.PUT
            W.DELETE -> H.DELETE
            W.TRACE -> H.TRACE
            W.CONNECT -> H.CONNECT
            W.OPTIONS -> H.OPTIONS

-- | 'Date' header and server identification.
convertMethod :: W.Method -> H.Method
convertMethod m =
    -- TODO: somehow return 'Bad Request' response
    -- instead of expecting the application host to
    -- catch errors.
    case W.parseMethod m of
      Left{} -> error $ "Unknown method " ++ (show . B8.unpack) m
      Right stdM ->
          case stdM of
            W.GET -> H.GET
            W.POST -> H.POST
            W.HEAD -> H.HEAD
            W.PUT -> H.PUT
            W.DELETE -> H.DELETE
            W.TRACE -> H.TRACE
            W.CONNECT -> H.CONNECT
            W.OPTIONS -> H.OPTIONS

-- | 'Date' header and server identification.
convertMethod m =
    -- TODO: somehow return 'Bad Request' response
    -- instead of expecting the application host to
    -- catch errors.
    case W.parseMethod m of
      Left{} -> error $ "Unknown method " ++ (show . B8.unpack) m
      Right stdM ->
          case stdM of
            W.GET -> H.GET
            W.POST -> H.POST
            W.HEAD -> H.HEAD
            W.PUT -> H.PUT
            W.DELETE -> H.DELETE
            W.TRACE -> H.TRACE
            W.CONNECT -> H.CONNECT
            W.OPTIONS -> H.OPTIONS

-- | 'Date' header and server identification.