Reputation: 31
I need to pass two headers with the same key in my $http request. This is a server requirement that can't be changed.
{ "Authorization": "Basic XXXX", "Authorization": "Basic YYYY" }
You pass headers into $http as an object, so I don't know how to send duplicate keys.
Upvotes: 1
Views: 97
Reputation: 31
I found the answer to my own question. The HTTP Spec requires that these two things are equal:
Header: Value1
Header: Value2
and
Header: Value1, Value2
And the second way is compatible with object literals.
See Are Duplicate HTTP Response Headers acceptable?
Upvotes: 2