This commit rework 1189ccc to prevent a mutate call on the original headers map. Closes gh-13871
1189ccc