I've added an http header manager with a Groovy script to vary the Http "Connection" header on each request. Sometimes it's "Close," sometimes it's "Keep-alive." This lets me simulate different http connection reuse scenarios. However instead of setting or replacing the default Connection header, I actually get a second Connection header added.
I've tried using both the HttpClient 4 and Java implementations and still get duplicate Connection headers, sometimes with different values.
I've tried putting the header manager as a child of the http request and as a peer.
I've tried checking and unchecking the "Use KeepAlive" box on the request.
No matter what, I get two Connection headers. One has the value I set and the other has the default value.
Is there a way to do this? I haven't yet checked what the server will do