User bio
404 bio not found
Member since Mar 22, 2023
Replies:

I have previously investigated a similar question, which came up when I was passing Content-Length in code headers but was seeing broker responses sometimes of Transfer-Encoding:chunked. 

At an abstracted level, IRIS sits on the left with the code -> CSP gateway sits in the middle -> web service sits on the right. 

Generally,

Web service will get and deal with headers as:
- If Content-Length is passed it will be used, and Transfer-Encoding will NOT be set

set %response.Headers("Content-Length") = %request.Get("FileSize",1)

- If there is no Content-Length, Transfer-Encoding will be determined and used

The CSP Gateway has settings which specify when to use Content-Length or Transfer-Encoding.
These can be changed to your specification.
For example, the Content-Length can be set to be always used, and never Transfer-Encoding.
 
In (my) CSP Gateway settings:
- Content-Length will be used if less than 0.005 GB 
- If more, then Transfer-Encoding will be used
This can cause the broker response to sometimes have Content-Length and sometimes have Transfer-Encoding:chunked based on file size.

Another layer of complexity,
There is built in logic in the CSP Gateway for:
- Before Transfer-Encoding, recognize large files and gzip them to compress.
This throws away previous headers and replaces them. This means that even if Content-Length is set in the headers or as default in the CSP Gateway, if the file is large enough it will be gzipped and Transfer-Encoding will occur anyways. 
To avoid Transfer-Encoding, solution is to force no gzipping in the CSP Gateway.

set %response.GzipOutput = 0 // Tell CSP gateway not to modify output, allows Content-Length header
Certifications & Credly badges:
Global Masters badges:
Followers:
Following:
Hannah has not followed anybody yet.