module Web.Minion.Request.Header.Internal where

import Data.ByteString
import Data.CaseInsensitive qualified as CI
import Data.Text (Text)
import Data.Text.Encoding qualified as Text.Encode

headerNotFoundError :: CI.CI ByteString -> Text
headerNotFoundError :: CI ByteString -> Text
headerNotFoundError CI ByteString
hn = Text
"Header not found: " Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> CI ByteString -> Text
headerToText CI ByteString
hn

headerToText :: CI.CI ByteString -> Text
headerToText :: CI ByteString -> Text
headerToText (ByteString -> Text
Text.Encode.decodeUtf8 (ByteString -> Text)
-> (CI ByteString -> ByteString) -> CI ByteString -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CI ByteString -> ByteString
forall s. CI s -> s
CI.original -> Text
txtHeader) = Text
txtHeader