From kde-commits Tue Apr 04 14:55:08 2006 From: Thiago Macieira Date: Tue, 04 Apr 2006 14:55:08 +0000 To: kde-commits Subject: branches/KDE/3.5/kdelibs/kioslave/http Message-Id: <1144162508.784243.21187.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=114416252903053 SVN commit 526404 by thiago: Keep the fragment when doing redirections. (the HTTP requests and redirections don't include fragments; it's a browser thing). BUG:124654 M +10 -0 http.cc --- branches/KDE/3.5/kdelibs/kioslave/http/http.cc #526403:526404 @@ -3596,6 +3596,16 @@ error(ERR_ACCESS_DENIED, u.url()); return false; } + + // preserve #ref: (bug 124654) + // if we were at http://host/resource1#ref, we sent a GET for "/resource1" + // if we got redirected to http://host/resource2, then we have to re-add + // the fragment: + if (m_request.url.hasRef() && !u.hasRef() && + (m_request.url.host() == u.host()) && + (m_request.url.protocol() == u.protocol())) + u.setRef(m_request.url.ref()); + m_bRedirect = true; m_redirectLocation = u;