Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
InterceptingClientHttpRequest replaces headers set in request factory instead of merging them [SPR-15166] #19732
When a custom requestFactory adds a header to the request and the RequestEntity contains the same header (e.g. cookies), the one in the RequestEntity will take precedence.
Checking the code in
ClientHttpRequest delegate = requestFactory.createRequest(request.getURI(), request.getMethod()); getHeaders().putAll(request.getHeaders());
Is this the desired behaviour? Would it be ok if the header values are added? What if the custom request factory wants to add a cookie and the request header adds a different cookie? (the last one will be in the header and the first one discarded)