It looks like we're not testing this code path, so I think you should probably start by adding a test that calls this and checks for both of these headers being added.