Skip to content

Instantly share code, notes, and snippets.

@jarrodek
Created April 20, 2016 11:48
Show Gist options
  • Save jarrodek/29491a10727ea65d999e56eefc768229 to your computer and use it in GitHub Desktop.
Save jarrodek/29491a10727ea65d999e56eefc768229 to your computer and use it in GitHub Desktop.
Headers object transforming headers cases
var headers = new Headers();
headers.append('Authorization', 'Basic abc');
headers.append('Connection', 'close');
var message = '';
for(var header of headers) {
message += header[0] + ': ' + header[1] + '\n';
}
var testConstruct = 'Authorization: Basic abc\n';
testConstruct += 'Connection: close\n';
console.assert(message === testConstruct, 'Headers are not the same.')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment