Added support for custom headers and Windows auth