# HTTP Request Corruption

On a site that receives a very high amount of traffic some small percent of requests come like this:

http://cheezburger.com/ScriptResource.axd?d=zaVpgH63ePt90pn</a>                                                   <br />                        <br />                        <p>                            <a id=


On the page referrer page there is a line like so:

<script src="/ScriptResource.axd?d=zaVpgH63ePt90p8fuEYkPAKFZuziMYsiIUbmxDb-gQ23Cx78LNJNFXTqKciA4ND_frR-_r9UKsdtLPk6M08xyk6cXFSLUrbBGDlvPIf-F9w1&amp;t=ffffffffd5e08dd5" type="text/javascript"></script>


and another couple lines much further on:

    <a id="login_LoginState_LoginButton" class="button1" UseSubmitBehavior="false" href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;login$LoginState$LoginButton&quot;, &quot;&quot;, true, &quot;ctl00\$Login1&quot;, &quot;&quot;, false, true))">Log In</a>
<br />
<br />
<p>


So it appears that part of the page has been removed. It appears to happen more often in IE than Firefox, but that might be because we have more IE traffic than FireFox. We have HTTP compression turned on, but I don't know if that is the problem.

So my question is what is going on and how can it be fixed?

-

Well, SO doesn't get as many requests as icanhascheezburger.com, that's for sure :) but I can tell you that we do get rare requests from browsers that are clearly .. broken .. in some fundamental way.

This is usually related to parts of the website (links, code, etc) that are built via JavaScript.

Apparently the browser has somehow screwed up the JavaScript code so badly that the resulting request back to us is utterly broken in ways that make no sense. Example. A vote for us looks like this:

/posts/12345/vote/2

but occasionally we'd get

/posts/true/vote/2

"true"? WTF? We used to look at these, but now we simply ignore them.

-
In this case I am ready to blame it on bad proxies. –  Stefan Rusek Sep 27 '09 at 3:38

We are seeing the same thing here in an application we have, it's a known IE8 issue that's been open a while. Here's the Microsoft Connect bug report.

Basically at some level IE8 just ignores packet loss and renders by appending the 2 packet streams together and ignoring the missing one. The result is some messed up URLs on your server. Since packets are roughly the same size most of the time, you'll often see URLs that start the same with some random script ending.

-
This occurrs in all versions of IE and FireFox. It isn't the IE8 bug in question. –  Stefan Rusek Sep 28 '09 at 10:01

just ignore the requests, this is most likely due to broken proxies or dns faults

-
don't understand how DNS faults can be involved. Can you explain please? –  AlberT Sep 8 '09 at 16:02
I would be fine with ignoring them, but they have also appear like XSS requests, which I can't ignore. –  Stefan Rusek Sep 8 '09 at 17:48

I've noticed on more than one occasion where IE has started downloading a page, then it begins rendering it before it finishes causing links to not form correctly. Usually the JS scripts are loading near the end of the page in these cases. On some of the larger pages, IE would download about half the page, try and render and then politely stop and drop the connection to the server, like WTF?

Anyway, in some cases, simply moving the JS includes to the top and then having the kick off nearer the bottom sorted some of the issues.