Commit 1bbe3573 authored by Dawit Alemayehu's avatar Dawit Alemayehu
Browse files

Added "no-www-auth" and "no-proxy-auth" KIO meta data flags. These

flags are needed to address a bug.

CCBUG: 135596
parent fe825254
......@@ -81,7 +81,9 @@ setcookies string Used to send/receive HTTP cookies when "cookies"
errorPage bool Flag that indicates that an errorPage() is preferred over an error(). (default:true)
no-auth bool Flag that indicates that no authentication attempts should be made.
no-auth bool Flag that indicates that no authentication (neither WWW nor proxy) attempts should be made.
no-www-auth bool Flag that indicates that no HTTP WWW authentication attempts should be made.
no-proxy-auth bool Flag that indicates that no HTTP proxy authentication attempts should be made.
no-auth-prompt bool Flag that indicates that only cached authentication tokens should be used.
no-preemptive-auth-reuse bool Flag that indicates whether cached credentials should be preemptively sent to the server.
......
......@@ -466,7 +466,9 @@ void HTTPProtocol::resetSessionSettings()
m_request.useCookieJar = config()->readEntry("Cookies", false);
m_request.cacheTag.useCache = config()->readEntry("UseCache", true);
m_request.preferErrorPage = config()->readEntry("errorPage", true);
m_request.doNotAuthenticate = config()->readEntry("no-auth", false);
const bool noAuth = config()->readEntry("no-auth", false);
m_request.doNotWWWAuthenticate = config()->readEntry("no-www-auth", noAuth);
m_request.doNotProxyAuthenticate = config()->readEntry("no-proxy-auth", noAuth);
m_strCacheDir = config()->readPathEntry("CacheDir", QString());
m_maxCacheAge = config()->readEntry("MaxCacheAge", DEFAULT_MAX_CACHE_AGE);
m_request.windowId = config()->readEntry("window-id");
......@@ -3439,7 +3441,8 @@ endParsing:
// TODO cache the proxy auth data (not doing this means a small performance regression for now)
// we may need to send (Proxy or WWW) authorization data
if (!m_request.doNotAuthenticate && isAuthenticationRequired(m_request.responseCode)) {
if ((!m_request.doNotWWWAuthenticate && m_request.responseCode == 401) ||
(!m_request.doNotProxyAuthenticate && m_request.responseCode == 407)) {
authRequiresAnotherRoundtrip = handleAuthenticationHeader(&tokenizer);
if (m_iError) {
// If error is set, then handleAuthenticationHeader failed.
......
......@@ -132,7 +132,8 @@ public:
endoffset = 0;
allowTransferCompression = false;
disablePassDialog = false;
doNotAuthenticate = false;
doNotWWWAuthenticate = false;
doNotProxyAuthenticate = false;
preferErrorPage = false;
useCookieJar = false;
}
......@@ -168,7 +169,8 @@ public:
bool isPersistentProxyConnection;
bool allowTransferCompression;
bool disablePassDialog;
bool doNotAuthenticate;
bool doNotWWWAuthenticate;
bool doNotProxyAuthenticate;
// Indicates whether an error page or error message is preferred.
bool preferErrorPage;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment