catching up network 3.0.

This commit is contained in:
Kazu Yamamoto 2019-01-21 12:14:35 +09:00
parent d11d63f1a6
commit 59ea282068

View File

@ -1,4 +1,5 @@
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE CPP #-}
module Network.Wai.Middleware.RequestLogger.JSON (formatAsJSON) where
@ -75,8 +76,10 @@ sockToJSON (SockAddrInet6 pn _ ha _) =
]
sockToJSON (SockAddrUnix sock) =
object [ "unix" .= sock ]
#if !MIN_VERSION_network(3,0,0)
sockToJSON (SockAddrCan i) =
object [ "can" .= i ]
#endif
queryItemToJSON :: QueryItem -> Value
queryItemToJSON (name, mValue) = toJSON (decodeUtf8With lenientDecode name, fmap (decodeUtf8With lenientDecode) mValue)