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