usebruno / bruno

Opensource IDE For Exploring and Testing Api's (lightweight alternative to postman/insomnia)
https://www.usebruno.com/
MIT License
27.56k stars 1.27k forks source link

Support for Multiple Headers with the Same Name #3475

Open ganesh-bruno opened 1 week ago

ganesh-bruno commented 1 week ago

I have checked the following:

Describe the feature you want to add

Currently, Bruno does not support sending multiple headers with the same name but different values.

In the Bruno app, when sending multiple headers with the same name but different values, only the last header is shown in the timeline. The previous headers with the same name are not displayed, making it difficult to verify all sent headers.

Mockups or Images of the feature

Here's the screenshot.

multiple-headers
stupidly-logical commented 1 week ago

Are we sure we want that? From https://www.rfc-editor.org/rfc/rfc7230#section-3.2.2

A sender MUST NOT generate multiple header fields with the same field
   name in a message unless either the entire field value for that
   header field is defined as a comma-separated list [i.e., #(values)]
   or the header field is a well-known exception (as noted below).

   A recipient MAY combine multiple header fields with the same field
   name into one "field-name: field-value" pair, without changing the
   semantics of the message, by appending each subsequent field value to
   the combined field value in order, separated by a comma.  The order
   in which header fields with the same field name are received is
   therefore significant to the interpretation of the combined field
   value; a proxy MUST NOT change the order of these field values when
   forwarding a message.

      Note: In practice, the "Set-Cookie" header field ([RFC6265]) often
      appears multiple times in a response message and does not use the
      list syntax, violating the above requirements on multiple header
      fields with the same name.  Since it cannot be combined into a
      single field-value, recipients ought to handle "Set-Cookie" as a
      special case while processing header fields.  (See Appendix A.2.3
      of [Kri2001] for details.)
hosadoya commented 6 days ago

Yes, this is a major issue. PostMan handles this correctly by not overwriting and sending multiple headers.