question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem with accessing headers value

See original GitHub issue

I have problem with accessing headers value. I can only read value of content-type. Am I doing something wrong?

I have code like this

return fetch(url)
            .then(response => {                    
                debugger;
                console.log(response.headers.get('Content-Type'))
                console.log(response.headers.get('Date'))
                return response;
            })
            .then(processStatus);

which prints: application/json; charset=utf-8 null

image

I have es6-promise installed, also added import "babel-polyfill"; on beginning of my scripts. I am using latest version which is 2.2.1

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:3
  • Comments:6

github_iconTop GitHub Comments

1reaction
AlexChesterscommented, Oct 11, 2016

My above issue was resolved in the same way as @fuglu. I had to add the header I was trying to access to the Access-Control-Expose-Headers header.

0reactions
betoharrescommented, Jun 19, 2017

@fuglu what’s the point to set Location HTTP header in this case? I don’t want to set a HTTP redirect nor I created something to define this variable, this is doesn’t make any sense to me 😦 also the solution didn’t work using it with electron.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Access-Control-Request-Headers - HTTP - MDN Web Docs
The Access-Control-Request-Headers request header is used by browsers when issuing a preflight request to let the server know which HTTP ...
Read more >
having trouble reading header values in classic ASP
I found my answer. When I ran this loop <% for each x in Request.ServerVariables response.write("<B>" & x & ":</b> " & Request....
Read more >
Access multi-value HTTP headers incorrectly in an API Proxy
Accessing the values of HTTP headers in Edge policies in a way that returns only the first value is incorrect and can cause...
Read more >
Unable to access the HttpServletRequest headers value ... - IBM
While attempting to access HttpServletRequest header value (such as "serviceID") in Faces Portlets before the JSP page is rendered, this value is not...
Read more >
Access multi-value HTTP headers incorrectly in an API Proxy ...
Accessing the values of HTTP headers in Apigee policies in a way that returns only the first value is incorrect and can cause...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found