emulate getallheaders if its not available