Ability to filter (show/hide) individual response headers in the response preview
See original GitHub issueGiven 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:
- Created 3 years ago
- Reactions:3
- Comments:6 (1 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
@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.