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

Response headers with empty values should return empty string, not null #7779

Closed
@jamshid

Description

@jamshid

If the response to a $http request contains a header but its value is empty, the value should be an empty string, not "null". Right?

I get foo == null even though X-Foo-Meta is in the response headers.

$http.get("/validate")
   .success(function(respBody, status, respHeaders, config) {
   $scope.foo = respHeaders('X-Foo-Meta');
   // it seems foo should be "", not null, here
   ...

The bug seems to be in angular.js v1.2.17

function headersGetter(headers) {
      ...
      return headersObj[lowercase(name)] || null;

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions