github graygnuorg/pound v4.20
Version 4.20

8 hours ago

New selection statement: Method

This conditional statement evaluates to true, if the request method matches the supplied pattern, e.g.:

Service
      Method "POST"
       ...
End

New internal backend: Success

Always returns a 200 response code. This is intended mainly for handling special requests. For example, the service definition below replies to the OPTIONS requests:

Service
      Method "OPTIONS"
      Rewrite response
              SetHeader "Access-Control-Allow-Origin: example.com"
              SetHeader "Access-Control-Allow-Methods: GET,POST,PUT"
              SetHeader "Access-Control-Max-Age: 1800"
      End
      Success
End

Changes in Lua API

  • http.req.body

    This field contains the captured content of the incoming request. For it to be available, content capturing must be explicitly enabled for the service on whose behalf the Lua code is called. Content capturing is enabled by the following new configuration statement:

    ContentCapture SIZE
    

    where SIZE sets the upper limit on the captured content size. If the actual content length is greater than this value, saved material is discarded and http.req.body is set to nil.

  • http.req.resend

    Lua functions invoked from Rewrite response can set this variable to true to have pound resend the modified request to backend. This can be used, for example, to handle 401 responses from the backend by inserting appropriately crafted Authorization header and resubmitting the request.

    To avoid dead loops, pound limits the number of such resends to 4 per request.

Don't miss a new pound release

NewReleases is sending notifications on new releases.