- Upgrade to version 32.1.2 to prevent Service Engine crashes triggered by HTTP Response Policy rules matching the Cache-Control or Set-Cookie headers.
- AV-271477:The Service Engine crashes (SIGSEGV) when an HTTP Response Policy rule targets the Cache-Control or Set-Cookie Headers. Please refer the release notes here
- Workaround: Use DataScript as a workaround instead of a Response Policy rules to match for these headers.
- Below is an example datascript that matches the requested URL path for "/abcd" and matches a specific value for the 'Cache-Control' header and replaces the header with a new value
- Navigate to Templates > Scripts > DataScripts and click on "Create"
- Enter a name for the script then under "HTTP Events" click on "ADD" select "HTTP Response". Copy/Paste the script and save
- Navigate to the virtual service and edit (pencil) go to the policies tab and select datascripts and click on "Add Datascript". Select the datascript object you created and save.
local path = avi.http.get_path()
if string.find(path, "^/abcd") then
local cc = avi.http.get_header("Cache-Control")
if cc and string.lower(cc) == "private, max-age=3600, no-transform" then
avi.http.replace_header("Cache-Control",
"private, max-age=7776000, no-transform, must-revalidate")
end
end
- The datascript can be modified based on the requirement. For more information related to datascript, please refer the document Datascript