Add an options object, and support for extra allowed headers.
merge new option from @jordan-ayers