Incorporate Tony Tam's changes to support Authorization Headers