bruno icon indicating copy to clipboard operation
bruno copied to clipboard

Display all request headers in Timeline tab

Open jackc opened this issue 1 year ago • 3 comments

I have a Rails API. I've been using curl to for ad hoc testing, but just tried using Bruno. Unfortunately, the experience was very confusing.

A Rails API that only handles json will typically work with or without an "Accept: application/json" header. So when using curl I do not include it. I did the same thing with Bruno and received an HTTP 406 Not Acceptable. I was unable to find any difference in the Bruno UI. However, I then pointed Bruno at a netcat listener so I could see exactly what was going over the wire. It is sending a default header of accept: application/json, text/plain, */*.

Further digging revealed that Rails treats any accept header including */* as coming from a browser and essentially overrides the accept header to only respond with html. (https://github.com/rails/rails/issues/40908 and https://github.com/rails/rails/blob/ae6fa7a048d0a0f79b0f8dd8566c7d499fd6f616/actionpack/lib/action_dispatch/http/mime_negotiation.rb#L171)

The underlying issue was with Rails. However, it was more difficult to diagnose because Bruno does not appear to expose all the actual request headers. The "Timeline" tab appears to show request headers, but it actually only shows the explicitly set headers. This was misleading. I wasn't expecting an accept header to be set at all, but it was happening invisibly.

Perhaps all request headers could be displayed in the Timeline view.

jackc avatar Oct 17 '23 15:10 jackc

I'd like this too - or alternatively extra tabs on the RHS which show actual request body & headers sent (i.e. after all scripts, vars, etc are evaluated) to assist with diagnosis

pete-mantell-giffgaff avatar Nov 24 '23 15:11 pete-mantell-giffgaff

Yes, this is a must-have in my opinion. I'm currently debugging why the API behaves differently when using Bruno vs. application code. Then it's crucial to know all headers that are sent.

palhal avatar Feb 12 '24 11:02 palhal

Same here. I was curious what the user agent value sent by Bruno was. Another use case I had a few months ago (in Insomnia) is debugging a problem with cookies.

Bruno should follow Insomnia's lead here and simply display all headers with their final values in the timeline tab.

bannmann avatar Mar 10 '24 09:03 bannmann