If a browser requests http://site.com/?q=abc
and gets a 301
redirect response to location http://site.com/?q=ABC
(note case of querystring)
Is it possible for the browser to ignore the difference in case and re-request http://site.com/?q=abc
, thus causing an infinite redirect loop?
That's the scenario that appears to be happening according to the IIS logs. It seems to be isolated to Internet Explorer with some variation of the Ask toolbar installed (based on user-agent values). I even installed the Ask toolbar, but have not been able to recreate this scenario in any way.
I can't post the source code, but for those that want something, here's the general logic:
Page_Load(object sender, EventArgs e)
{
var q = Request.QueryString["q"];
if (q == "ABC")
{
//render page as usual
}
else
{
Response.RedirectPermanent("[thispage]?q=ABC");
}
}
As you can see, if this page is requested with ?q=abc
it will be redirected once, but then it'll render as usual because the redirect goes to ?q=ABC
.
Is there any scenario where the browser (specifically IE with the Ask toolbar) could ignore the case of the redirect location, causing an endless loop?