Question for SCGI implementation: I know that the headers are netstring encoded, meaning the entire string of headers are prepended with the string size and a colon and appended with a comma, like ":,"

What I'm wondering is if the body part after that is *also* netstring encoded. The Wikipedia page suggests the body is just raw data: https://en.wikipedia.org/wiki/Simple_Common_Gateway_Interface

However, I believe @gritty linked to a different source that suggests the body (which is presumably used for the upload data for protocols like Spartan and Titan) is netstring-encoded.

I would love to know how this is implemented in any existing Spartan or Titan servers that support SCGI.

My servers currently do not netstring-encode the body (the upload data for Titan and Spartan) because that just doesn't make sense for binary data, and I find it to be very unnecessary overall, especially when you already have a content_length header that tells the size of the body.

๐Ÿš€ clseibold

May 01 ยท 2 months ago

1 Comment

๐Ÿ€ gritty ยท May 01 at 22:55:

I don't think you need to netstring encode the body, even if it specifies it in the spec. like you said, content_length makes it redundant.


Source