<div dir="ltr">Hi<div><br></div><div>I have an environment with squid version 5.0.4 with ICAP server adapting requests by adding an header.</div><div>When I'm trying to send a POST request with a body I'm having an issue of a stuck connection.</div><div>What should the ICAP response look like?</div><div><br></div><div>What I do is to reply like this:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">(dI./M..ICAP/1.0 200 OK<br>ISTag: "SjIzlRA4te41axxcDOoiSl6rBRg4ZK"<br>Date: Sun, 17 Jan 2021 19:34:12 GMT<br>Server: BaseICAP/1.0 Python/3.6.12<br>Encapsulated: req-hdr=0, req-body=360<br><br>POST <a href="http://www.dst-server.com:22222/v1/test">http://www.dst-server.com:22222/v1/test</a> HTTP/1.1<br>x-new-header: {"key": "value"}<br>user-agent: python-requests/2.25.1<br>accept-encoding: gzip, deflate<br>accept: */*<br>content-length: 16<br>content-type: application/json<br>host: <a href="http://www.dst-server.com:22222">www.dst-server.com:22222</a><br></blockquote><div><br></div><div> Please assume the number in req-body=360 is correct (I trimmed here the content of the new header).</div><div>As I said, I use 'Preview: 0' since I don't mind the body. The question is whether declaring the body starts at X (req-body=X) is OK even though I don't have a body to send? I think having req-null=X is bad since it probably tells squid that I decided the adapted request should have no body, but that's only a guess.</div><div><br></div><div>When the ICAP doesn't adapt the request, everything looks fine.</div><div>When it adapts the request I see that the POST request squid sends to <a href="http://www.dst-server.com">www.dst-server.com</a> doesn't contain the body.</div><div><br></div><div>On the logs of the server behind <a href="http://www.dst-server.com">www.dst-server.com</a> I see an entry for the API request only after I abort the request I sent.</div><div><br></div><div>I use python's requests module to make the request:<br><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">import requests<br>s = requests.Session()<br>s.proxies = {'http': 'localhost:8000', 'https': 'localhost:8000'} </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">resp = <a href="http://s.post">s.post</a>('<a href="http://www.dst-server.com:22222/v1/test">http://www.dst-server.com:22222/v1/test</a>', allow_redirects=False, json={'key': 'value'})<br></blockquote><div> </div></div><div>I'll highly appreciate any help.</div><div>Thanks,</div><div>Moti</div></div>