Chrome returns “Bad Request - Request Too Long” when navigating to local IIS Express

痴心易碎 提交于 2019-11-30 04:31:40

I get this all the time ONLY in Chrome and I have to clear browsing data to fix it.

Wrench > Tools > Clear Browsing Data

Check the following:

  • Clear browsing history
  • Clear download history
  • Empty the cache
  • Delete cookies and other site data

Then click "Clear Browsing Data" button and refresh your page.

UPDATE:
I figured out that it has to do with writing too many cookies to the browser and that if you just close all instances of Chrome, the error goes away for a while. To prevent it, you'll need to clear out your cookies programmatically.

This error is caused by a corrupt cookie for the website you are trying to view, so to clear it all you need to do is clear the bad cookie(s) for that website.

In Chrome, go to...

chrome://settings/cookies

(Or manually go to Settings->Advanced Settings->Privacy->Content->All Cookies and Site data)

From there, you can search for cookies that match the site you are having problems on. Finally, click "remove all" for the matching cookies.

Instead of clearing all the cookies, just do the following:

  • Right click the lock in the address bar area (see picture below)
  • Under cookies there is a link saying how many cookies are used
  • Click that link
  • Remove all cookies in there (or just the troublesome if you can identify them)
  • Problem gone

N8allan

The problem is usually that the site in question has accumulated too many cookies or created cookies which are too large, making the HTTP headers swell beyond the allowed maximum.

One-time work-around

As has been mentioned, you can go to Settings|Advanced|Content Settings|All Cookies and Site Data, search for the site in question, and delete the cookies using the X button on the right. This reduces the header size of the HTTP request when contacting the site.

Long-term work-around

In addition to removing them one-time, however, you can prevent further problems with heavy cookie sites by going to Settings|Advanced|Content Settings|Manage Exceptions, and add the base site url (e.g. "msdn.microsoft.*" without the quotes) and select Behavior as "Clear on Exit". You might have to login more often to these sites, but this should prevent the problem.

I encountered this problem when using ADB2C login from ASP.NET WebApp. In Firefox you can do similar use case to delete related coockies and problem is gone for a while. Click on HTTPS (i) lock icon with, select ">" button on the right, select More information, select Security tab, click on View Cookies and click on Remove All. Done 4 a while.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!