开发者

ASP.NET MVC jQuery ajax call returns status code -504 instead of 5xx on Safari 4

开发者 https://www.devze.com 2022-12-23 11:35 出处:网络
My MVC controllers return 5xx status codes to indicate errors when called using jQuery ajax. This works great on IE8 and Firefox.

My MVC controllers return 5xx status codes to indicate errors when called using jQuery ajax. This works great on IE8 and Firefox.

Howe开发者_开发百科ver, on my copy of Safari 4.0.5 running on Vista, this breaks. It looks like Safari is translating my 5xx status codes to -504.

Successful ajax calls work fine, and I've already tried uninstalling and reinstalling Safari.

Does anyone know what this status code means? I couldn't find any references to it online.


We encountered this problem at our workplace. Based on our testing, it seems that Safari only allocates 9 bits for the status field in the xmlhttpresponse. This means that HTTP status 599 gets converted to -425 because the bit patterns are the same:

0000 0010 0101 0111  599
1111 1110 0101 0111 -425

So stick to error codes less than 512 and it should work.


I keep having the same problem. I tried increasing the max request length in the web.config and it didn't help.

<httpRuntime maxRequestLength="60240"/>

The only thing that seems to get it to work is to shrink the size of the request. It happens because the header information is too large. This isn't a viable solution for me so I'm still looking into a permanent fix.

You can mess around with the header size in fiddler and see what i'm talking about.

I HAVE FIXED THE PROBLEM!!!! I was having an unrelated problem with my computer overheating and it was being caused by avg ~13 processes running in the back ground. I uninstalled AVG and installed windows security essentials and not it works.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号