only set headers if origin

cc @mrhooray @sh1mmer