Fix broken http-reverse-proxy < 0.6 support

This commit is contained in:
Michael Snoyman 2018-04-26 12:17:00 +03:00
parent 07df43f207
commit bc4ecd7dc8
No known key found for this signature in database
GPG Key ID: A048E8C057E86876
3 changed files with 15 additions and 2 deletions

View File

@ -1,3 +1,7 @@
## 1.6.0.2
* Fix broken support for older http-reverse-proxy
## 1.6.0.1
* Support for http-reverse-proxy 0.6

View File

@ -38,7 +38,12 @@ import Network.HTTP.Client.TLS (tlsManagerSettings)
import Network.HTTP.ReverseProxy (ProxyDest (ProxyDest),
waiProxyToSettings,
wpsOnExc, wpsTimeout,
defaultWaiProxySettings)
#if MIN_VERSION_http_reverse_proxy(0, 6, 0)
defaultWaiProxySettings
#else
def
#endif
)
import qualified Network.HTTP.ReverseProxy as ReverseProxy
import Network.HTTP.Types (status200, status503)
import qualified Network.Socket
@ -147,7 +152,11 @@ reverseProxy opts appPortVar = do
return $
ReverseProxy.WPRProxyDest
$ ProxyDest "127.0.0.1" appPort)
#if MIN_VERSION_http_reverse_proxy(0, 6, 0)
defaultWaiProxySettings
#else
def
#endif
{ wpsOnExc = \e req f -> onExc e req >>= f
, wpsTimeout =
if proxyTimeout opts == 0

View File

@ -1,5 +1,5 @@
name: yesod-bin
version: 1.6.0.1
version: 1.6.0.2
license: MIT
license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com>