ALERT: Some images may not load properly within the Knowledge Base Article. If you see a broken image, please right-click and select 'Open image in a new tab'. We apologize for this inconvenience.

Controlling HTTP requests and responses with the Content-Length header

book

Article ID: 165622

calendar_today

Updated On:

Products

ProxySG Software - SGOS

Issue/Introduction

In SGOS 6.3 and earlier, the CPL conditions request.header.content-length.regex= and response.header.content-length.regex= are used to control HTTP requests and responses based on the size of the body text as reported in the Content-Length header. This requires that the Content-Length header is provided by the user-agent generating the request or the server generating the response header (it is optional) and that it is accurate.

Resolution

SGOS 6.4 introduces the following new controls to test the actual size of http request body content without the need to rely on specific HTTP headers:
http.request.body.max_size()
http.request.body.size=
http.request.body.max_size_exceeded=

More information on these preferred properties and conditions can be found in the SGOS 6.4 Command Line Interface Reference reference guide. 

If you need to control traffic based on the HTTP Content-Length header, SGOS 6.4 also introduces
request.header.content-length.as_number= and
response.header.content-length.as_number= conditions.

Unlike with the .regex condition modifier, there is a marked performance improvement when using these CPL conditions and properties.

Due to the availability of the above alternatives, response.header.content-length= and request.header.content-length.regex= will not be documented in the SGOS 6.4 Command Line Interface Reference.