enhancement: Support Skyhigh Security ICAP as an ICAP server

This commit is contained in:
Florian Schade
2024-08-04 14:00:20 +02:00
parent e14773628d
commit 3665c9dba6
10 changed files with 336 additions and 24 deletions
+2 -3
View File
@@ -102,13 +102,12 @@ func (c *ICAPConn) Send(in []byte) ([]byte, error) {
data = append(data, tmp[:n]...)
// explicitly breaking because the Read blocks for 100 continue message
// fixMe: still unclear why this is happening, find out and fix it
if bytes.Equal(data, []byte(icap100ContinueMsg)) {
break
}
// EOF detected, 0 Double crlf indicates the end of the message
if bytes.HasSuffix(data, []byte("0\r\n\r\n")) {
// EOF detected, double crlf indicates the end of the message
if bytes.HasSuffix(data, []byte(doubleCRLF)) {
break
}
+1 -1
View File
@@ -55,7 +55,7 @@ const (
schemeHTTPReq = "http_request"
schemeHTTPResp = "http_response"
crlf = "\r\n"
doubleCRLF = "\r\n\r\n"
doubleCRLF = crlf + crlf
lf = "\n"
bodyEndIndicator = crlf + "0" + crlf
fullBodyEndIndicatorPreviewMode = "; ieof" + doubleCRLF