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