Issue with URL class / works when using cURL

I’ve had a rather weird issue today where after updating to JUCE 6 (in order to use cmake…) I could not control a MOTU UltraLite AVB via HTTP and JSON anymore. After a rather lengthy investigation together with my colleagues we’ve found a small difference in behaviour between the JUCE HTTP client and its cURL equivalent, which we suspect to be the reason for the failure: JUCE seems to add one more newline character after the header compared to cURL.

with “JUCE_USE_CURL=0”:

POST /datastore/ext/obank HTTP/1.1
Host: localhost:8000
User-Agent: JUCE/6.0.0
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-length: 365


json={"0/ch/0/src":"", [...]

with “JUCE_USE_CURL=0” commented out and “NEEDS_CURL TRUE”:

POST /datastore/ext/obank HTTP/1.1
Host: localhost:8000
User-Agent: curl/7.68.0
Accept: */*
Content-Type: application/x-www-form-urlencoded
Content-length: 365

json={"0/ch/0/src":"", [...]

The Accept: and Connection: headers seem not to have any influence (I’ve tried that already using cURL from the command line).

Is this a known bug? Or am I doing something wrong that causes the extra newline?