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.

Response Header population inconsistent

See original GitHub issue

Been trying to track down more details on this one but am pressed for time and replication is odd.

Queries that do not have parameters and do not have specific FeedOptions do not populate Response headers. Expectation is that headers always are populated in the response.headers.

Example: let querySpec = { query: "SELECT, C.company_name FROM Customers C" };

let response = await this.container.items.query(querySpec, options).toArray();

Cases when response.headers is empty based on options: options = {} options = { enableCrossPartitionQuery: true, populateQueryMetrics: true }

Cases when its populated let options = { enableCrossPartitionQuery: true, populateQueryMetrics: true, maxItemCount: 1 } p.s. maxItemCount isnt being respected either but will log a separate issue for that.

Second, if querySpec has params headers are populated. If querySpec does not have params but the query itself has something like Status = 1, headers populate.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

southpolestevecommented, Oct 15, 2018

@dustensalinas Thanks for the report. This has come up before and it is something we do need to fix. The issue is similar to #157 in that toArray() can result in many calls to the server. If you are looking for granular metrics, your best bet is to step through the calls yourself using methods on QueryIterator like executeNext() or getAsyncIterator(). Those return headers for each request. I’m going to leave this open while I discuss with the team the best way to report headers/metrics( on toArray() results.

dustensalinascommented, Dec 21, 2018

I’ve now run across this bug/enhancement in another project and got me thinking about it again. I think the real difficulty here is the inconsistency (ie if only one query was called then it populates vs not). Might I suggest the response headers be populated in an array? This way no odd transformations but if we call something like toarray and multiple requests were needed to populate it, we know that there are multiple headers and can address appropriately vs sometimes there and sometimes undef?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncovering HTTP Header Inconsistencies and the Impact on ...
1. Presence Inconsistency. In this scenario, a critical security header is present in one user agent, but missing in the other. An attacker...
Read more >
response.headers['content-type'] is inconsistent on image url
I have a very simple url verification function in node. This function takes an image url and makes a request to that url...
Read more >
Response Header - an overview | ScienceDirect Topics
A server may respond to these “usual” types of requests with Access-Control-headers.
Read more >
Tyk-Gateway/Virtual Endpoint: Request headers vs. Response ...
Hi, I am currently evaluating tyk-gateway for a project. The idea is simple: The frontend (browser) connects to a backend (rest) via ...
Read more >
Inconsistent response header representation for HTTP/1.1 vs ...
When asking curl to print the HTTP headers (either by using -v or -I ), the representation of the response headers is different...
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 Post

No results found

github_iconTop Related Hashnode Post

No results found