Created
April 20, 2016 11:48
-
-
Save jarrodek/29491a10727ea65d999e56eefc768229 to your computer and use it in GitHub Desktop.
Headers object transforming headers cases
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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