Headers are being restored even after using disableAutoReferer in chaining

Hi All,

I am trying to initialize headers for each request separately as my headers are different for each request, however I need to chain these requests.
While chaining the second http request is taking the headers of previous request and are being forwarded. Do we have a solution to avoid this ?

PS: I am using disableAutoReferer in the main Http request in the class.


val httpProtocol = http.disableAutoReferer.disableCaching
 .acceptEncodingHeader("gzip, deflate")
 .userAgentHeader("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Safari/537.36")
 .header("Referer", base_url)

My request is as