Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Allow multiple headers with the same name to be retrieved from a HTTP Promise #9473

Closed
ChrisPearce opened this issue Oct 7, 2014 · 2 comments

Comments

@ChrisPearce
Copy link

Responses may sometimes include multiple headers with the same header name. For example, a HTTP response may include multiple "www-authenticate" headers.

Under this scenario, the current way of retrieving the header values (e.g. calling headers('www-authenticate') from within the function ".error(function(data, status, headers, config) {" ) only retrieves the first header.

@Narretz
Copy link
Contributor

Narretz commented Oct 8, 2014

Are you sure you are only getting the first header? The way the parser is built, you should be getting a comma-separated string as value.

edit: this is difficult to test, because httpBackend.expect doesn't allow duplicate header keys

@pkozlowski-opensource
Copy link
Member

@Narretz is right - the current code in master seems to be handling this situation correctly.
I've opened PR #10176 to add the explicit test.

pkozlowski-opensource added a commit to pkozlowski-opensource/angular.js that referenced this issue Nov 22, 2014
gkalpak pushed a commit to gkalpak/angular.js that referenced this issue Dec 5, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants