Metaswitch/sprout — pull request #816 by mike-evans (2014-10-16 11:23:52+00:00)
Title: [Reviewer Andy] Remove extra Via header when attempting to send to a unresolvable URI

Andy

Can you review my fix to #794. The issue explains the exact scenario. I decided the cleanest fix was to make the UACTsx responsible for removing the extra Via header from the request before reporting errors upstream. This isn't perfect, but I think it is the best we can do without introducing another clone of the request.

The SproutletProxy.UnrecognisedSproutlet test case already exercised this case, but the response matcher utility in siptest isn't clever enough to spot it, so I've verified the fix by checking trace output. I've also run all the UTs and the live tests to make sure nothing else has broken.

I also cleaned up when the Via header is added - at the moment it was being done in a couple of places before the UACTsx was created, so I moved it in to the UACTsx::init() routine to make it cleaner.

Mike