[英]HTTP 400. The size of the request headers is too long
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd"> <HTML><HEAD><TITLE>Bad Request</TITLE> <META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD> <BODY><h2>Bad Request - Request Too Long</h2> <hr><p>HTTP Error 400. The size of the request headers is too long.</p> </BODY></HTML>
I have ac# web api along with angularjs webapp that is behaving rather weird on a deployment server.我有 ac# web api 以及在部署服务器上表现得相当奇怪的 angularjs webapp。
It randomly throws 400 Bad Request error for same Web API calls that worked a second ago.对于一秒钟前工作的相同 Web API 调用,它会随机抛出 400 Bad Request 错误。 Initially deleting cookies and clearing cache would fix these errors, but since the past few days, even that doesn't work.
最初删除 cookie 和清除缓存可以解决这些错误,但自过去几天以来,即使这样也行不通。
I checked my header size, it is well within limits.我检查了我的标题大小,它完全在限制范围内。 I have 4 cookies almost 4 MB each, so that shouldn't be an issue.
我有 4 个 cookie,每个几乎 4 MB,所以这应该不是问题。
Also, this happens only on a QA environment (load balanced with 2 boxes) but not on any other environments.此外,这仅发生在 QA 环境(用 2 个盒子进行负载平衡)中,而不发生在任何其他环境中。
Any suggestions?有什么建议?
EDIT: Here is the browser's response Bad Request - Request Too Long HTTP Error 400. The size of the request headers is too long.编辑:这是浏览器的响应错误请求 - 请求太长 HTTP 错误 400。请求标头的大小太长。
The issue was large cookie size resulting from too many claims that I was storing in it.问题是由于我在其中存储了太多声明而导致 cookie 大小过大。 Addressed it by reducing the number of claims (custom claims) which weren't needed and now it works fine.
通过减少不需要的声明(自定义声明)的数量来解决这个问题,现在它可以正常工作。
Will need to figure out in the future, alternative ways to pass the user's claims going forward should the app indeed have that many claims.如果应用程序确实有这么多声明,将来需要找出其他方法来传递用户的声明。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.