on master help sign in
catching up network 3.0.
59ea282Kazu Yamamoto
wai-extra/Network/Wai/Middleware/RequestLogger/JSON.hs+3
@@ -1,4 +1,5 @@
1{-# LANGUAGE RecordWildCards #-}
1{-# LANGUAGE RecordWildCards #-}
2+{-# LANGUAGE CPP #-}
2
3
3module Network.Wai.Middleware.RequestLogger.JSON (formatAsJSON) where
4module Network.Wai.Middleware.RequestLogger.JSON (formatAsJSON) where
4
5
@@ -75,8 +76,10 @@ sockToJSON (SockAddrInet6 pn _ ha _) =
75 ]
76 ]
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 ]
82+#endif
80
83
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)