How long of a URL can Internet Explorer 9 take?

前端 未结 3 1364
长情又很酷
长情又很酷 2020-12-01 20:58

Past versions of Internet Explorer croaked on web addresses longer than 2,083 characters (see http://support.microsoft.com/kb/208427). Meanwhile, Firefox, Opera, and Safari

3条回答
  •  攒了一身酷
    2020-12-01 21:30

    I wrote this test that keeps on adding 'a' to parameter until browser fails

    C# part:

    [AcceptVerbs(HttpVerbs.Get)]
    public ActionResult ParamTest(string x)
    {
        ViewBag.TestLength = 0;
        if (!string.IsNullOrEmpty(x))
        {
            System.IO.File.WriteAllLines("c:/result.txt", 
                           new[] {Request.UserAgent, x.Length.ToString()});
            ViewBag.TestLength = x.Length + 1;
        }
    
        return View();
    }
    

    View:

    
    
    
    

    I added additional limits to IISExpress applicationhost.config and web.config setting maxQueryStringLength="32768".

    also Added to config

    
        
    
    

    which didn't help at all, Finally decided to use fiddler to remove referer from header.

    static function OnBeforeRequest(oSession: Session) {
    if (oSession.url.Contains("localhost:50766")) {
            oSession.RequestHeaders.Remove("Referer");
            }
    

    Which did nicely.

    On IE9 I got

    Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)
    4043
    

提交回复
热议问题