Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-49659

QHttpNetworkRequest: Add support for custom ordering of headers

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • None
    • Network, Network: HTTP
    • None

    Description

      RFC7230 on the order of the http header fields:
      The order in which header fields with differing field names are received is not significant. However, it is good practice to send header fields that contain control data first, such as Host on requests and Date on responses, so that implementations can decide when not to handle a message as early as possible.
      Ref: https://tools.ietf.org/html/rfc7230#section-3.2.2

      There are are some server implementations that uses the User-Agent AND the order of the header fields to determine what client the user is actually using. Most http-clients offer to override the User-Agent, but the field order is in most cases not possible to specify.

      See attached images for how an Incapsula-enabled site sends a different response where two clients sends the same header data, but in different order.

      If we had a way to specify the order of fields, it would be possible to circumvent these restrictions.

      QHttpNetworkRequestPrivate::header
      This function should have access to a list of strings containing the desired order of the headers. When producing the http header chunk, the ordered headers should be prioritized first.
      Any remaining headers should be added last.

      Attachments

        1. 1_firefox.png
          1_firefox.png
          92 kB
        2. 2_qt.png
          2_qt.png
          86 kB

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              richmoore Richard Moore (qtnetwork)
              Spartakus Vidar F
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes