copy the input headers object #1060
Merge pull request #1063 from finnp/headers-ref

copy the input headers object #1060