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

QHttpNetworkConnectionPrivate::createAuthorization() in qhttpnetworkconnection.cpp sets header with lower case "a" in "authorization"

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Done
    • P0: Blocker
    • 4.6.0
    • 4.5.3
    • Network
    • None

    Description

      QHttpNetworkConnectionPrivate::createAuthorization() in qhttpnetworkconnection.cpp sets header with lower case "a" in "authorization". Is there any way this text could be "Authorization" with a capital 'A' instead? Logging into our devices over HTTP using QtWebKit fails authorization because the device excepts "Authorization". Yes the developers should have used a case insensitive compare, but we have dozens of devices and years of deployment of these devices.
      -David

      void QHttpNetworkConnectionPrivate::createAuthorization(QAbstractSocket *socket, QHttpNetworkRequest &request)
      {
      Q_ASSERT(socket);

      int i = indexOf(socket);

      if (channels[i].authMehtod != QAuthenticatorPrivate::None) {
      if (!(channels[i].authMehtod == QAuthenticatorPrivate::Ntlm && channels[i].lastStatus != 401)) {
      QAuthenticatorPrivate *priv = QAuthenticatorPrivate::getPrivate(channels[i].authenticator);
      if (priv && priv->method != QAuthenticatorPrivate::None)

      { QByteArray response = priv->calculateResponse(request.d->methodName(), request.d->uri(false)); request.setHeaderField("authorization", response); }

      }
      }
      if (channels[i].proxyAuthMehtod != QAuthenticatorPrivate::None) {
      if (!(channels[i].proxyAuthMehtod == QAuthenticatorPrivate::Ntlm && channels[i].lastStatus != 407)) {
      QAuthenticatorPrivate *priv = QAuthenticatorPrivate::getPrivate(channels[i].proxyAuthenticator);
      if (priv && priv->method != QAuthenticatorPrivate::None)

      { QByteArray response = priv->calculateResponse(request.d->methodName(), request.d->uri(false)); request.setHeaderField("proxy-authorization", response); }

      }
      }
      }

      Attachments

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

        Activity

          People

            mgoetz Markus Goetz (Inactive)
            dgarrett97 David Garrett
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes