ngx-export-tools-extra 0.6.1.0 → 0.6.1.1
raw patch · 3 files changed
+37/−3 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Changelog.md +1/−1
- NgxExport/Tools/Subrequest.hs +35/−1
- ngx-export-tools-extra.cabal +1/−1
Changelog.md view
@@ -1,7 +1,7 @@ ### 0.6.1.0 - Handler *extractRequestStatusFromFullResponse* was replaced with handler- *extractExceptionFromFullResponse*. The new handler contains the error message+ *extractExceptionFromFullResponse*. The new handler extracts the error message if the subrequest was terminated by an exception. ### 0.6.0.0
NgxExport/Tools/Subrequest.hs view
@@ -685,7 +685,7 @@ -- and forwarded downstream to the client in directive /haskell_content/. -- Handlers __/fromFullResponse/__ and __/fromFullResponseWithException/__ -- perform such a translation. Not all response headers are allowed being--- forwarded downstream, and thus the handler deletes response headers with+-- forwarded downstream, and thus the handlers delete response headers with -- names listed in set 'notForwardableResponseHeaders' as well as all headers -- with names starting with /X-Accel-/ before sending the response to the -- client. The set of not forwardable response headers can be customized in@@ -696,6 +696,13 @@ -- -- ==== File /nginx.conf/: forward responses from location /\/full/ -- @+-- set $proxy_with_exception $arg_proxy$arg_exc;+--+-- if ($proxy_with_exception = yesyes) {+-- haskell_content fromFullResponseWithException $hs_subrequest;+-- break;+-- }+-- -- if ($arg_proxy = yes) { -- haskell_content fromFullResponse $hs_subrequest; -- break;@@ -714,6 +721,33 @@ -- > Subrequest-Header: This is response from subrequest -- > -- > In backend, Custom-Header is 'Value'+--+-- Now let's get an error message in the response after feeding a wrong port+-- value.+--+-- > $ curl -D- 'http://localhost:8010/full/?a=Value&p=8021&proxy=yes&exc=yes'+-- > HTTP/1.1 502 Bad Gateway+-- > Server: nginx/1.19.4+-- > Date: Mon, 14 Dec 2020 08:24:22 GMT+-- > Content-Length: 593+-- > Connection: keep-alive+-- >+-- > HttpExceptionRequest Request {+-- > host = "127.0.0.1"+-- > port = 8021+-- > secure = False+-- > requestHeaders = [("Custom-Header","Value")]+-- > path = "/proxy"+-- > queryString = ""+-- > method = "GET"+-- > proxy = Nothing+-- > rawBody = False+-- > redirectCount = 10+-- > responseTimeout = ResponseTimeoutDefault+-- > requestVersion = HTTP/1.1+-- > proxySecureMode = ProxySecureWithConnect+-- > }+-- > (ConnectionFailure Network.Socket.connect: <socket: 31>: does not exist (Connection refused)) -- | Default set of not forwardable response headers. --
ngx-export-tools-extra.cabal view
@@ -1,5 +1,5 @@ name: ngx-export-tools-extra-version: 0.6.1.0+version: 0.6.1.1 synopsis: More extra tools for Nginx haskell module description: More extra tools for <https://github.com/lyokha/nginx-haskell-module Nginx haskell module>.