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.

Ability to filter (show/hide) individual response headers in the response preview

See original GitHub issue

Given a response of

HTTP/1.1 200 OK
Server: nginx
Date: Mon, 07 Dec 2020 21:57:59 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: close
Vary: Accept-Encoding
Content-Length: 807

I would like to specify a document variable in the request to filter the headers that are displayed in the preview window.

# Only these headers are shown in the response preview
@response.show_headers = ["Content-Type", "Content-Length"]

###
GET {{scheme}}://{{host}}/ HTTP/1.1

Example output for above:

HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Content-Length: 807

Alternately, specify headers to be hidden:

@response.hide_headers = ["Server", "Date"]

###
GET {{scheme}}://{{host}}/ HTTP/1.1

And the intended output:

HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: close
Vary: Accept-Encoding
Content-Length: 807

Happy to do this myself and supply a PR, but I need some pointers about how to get at a document’s variables during formatHeaders

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ShonFraziercommented, Dec 8, 2020

My use case is educational: I need to trim out the noise while demonstrating a new REST API. I feel like the show/hide lists have ultimate flexibility, but I could see the benefit of a flag/switch on displaying response headers whose name matches a request header whose value was set by variable.

I think I prefer the suffix syntax for the flag/switch simply for visibility (the header names would all still be aligned on the left) and editing (I feel it’s easier to add/remove from the end of the line.)

Colorization on flagged request headers would be a nice touch (those with the ‘sensitive’ indicator could change to, say, red to be more obvious), and maybe a button on the preview to reveal hidden headers, and when revealed, ‘hidden’ headers become red also.

0reactions
mbronkcommented, Nov 14, 2021

@ShonFrazier - For my own purpose (recording an API demo) I’ve added a very rudimentary “hide headers” functionality (PR above). Not the full implementation you were proposing, but perhaps you would find some use for it anyway.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Filter Response Headers via JavaScript Policy
I would like to be able to filter this information, but am having difficulties parsing this array and keeping only specific response headers....
Read more >
HTTP Debugger Manual
HTTP Debugger automatically processes and shows all the HTTP response header parameters in the Response Header pane in an easy to understand tabular...
Read more >
Request and Response Transforms
YARP copies most response headers from the proxy response by default (see ResponseHeadersCopy). Some security models only allow specific headers to be proxied....
Read more >
Java filter failing to set response headers - Stack Overflow
xml):. Servlet spec (section 6.2.4):. "The order the container uses in building the chain of filters to be applied for a particular request ......
Read more >
Safari Technology Preview Release Notes - Apple Developer
commitStyles() not changing the style attribute for individual CSS transform ... Changed to not route the navigation preload response body to the service ......
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