janhommes / o.js

o.js - client side oData lib.
https://janhommes.github.io/o.js/example/
MIT License
241 stars 58 forks source link

.fetch doesn't return headers #117

Closed jeffersoneagley closed 3 years ago

jeffersoneagley commented 3 years ago

I'm doing this:

    const oQueryResponseList = await odata(
      url
      getDefaultRequestConfig()
    )
      .get(endpoint)
      .fetch(someQuery);
    const myHeader = response.headers.get('x-some-header');

When I do this, I don't get any headers back, just null. Is this supposed to be not supported?

janhommes commented 3 years ago

Basically, it's the fetch response. So yes this should be supported. Your sure this header is set by your server? Also what happens if you ask for some default header like content-type?