gpt4 book ai didi

proxy - 缺少代理服务器的 POST 参数

转载 作者:行者123 更新时间:2023-12-04 12:59:47 37 4
gpt4 key购买 nike

我们的 Web 应用程序遇到了一些奇怪的行为。某些 POST 请求没有任何 http 正文,但它们应该有。 content-length 为 0。根本没有 post 参数。我们在负载均衡器上跟踪了网络流量,我们发现我们的一些 POST 请求没有收到任何请求正文。

所有损坏的 POST 请求都有一个共同点,即它们通过代理服务器到达。

我们已经在 SO 上找到了这个问题:
Why "Content-Length: 0" in POST requests?

我们现在正在使用框架转义 javascript 例程,它有点帮助。似乎错误率下降了。但是我们仍然有没有数据的 POST 请求,这在我们的 web 应用程序中不应该发生。这些请求并非来自黑客或类似者。

我们经常将 webwasher 视为代理。但是大多数时候我们看不到使用了哪个代理。

在此 PDF 中,我们看到了有关 webwasher 丢失 POST 参数的评论

WebWasher - Transparent Authentication Guide

Notes on Some Pitfalls

Note that there are some pitfalls that must be taken into account when setting up transparent authentication:

POST requests will fail if the ICAP server sends an redirect to the authentication server. This affects, however, only the renewal of the mapping since for the browser the request was successful, and the POST body will not be sent again after the final redirect.



我们想知道除了仅使用 GET 而不是 POST 之外是否还有其他解决方法。
如果其他站点在丢失 POST 数据以及他们得出的结论方面存在问题,我们也会在这里。

不发送 POST 数据还有其他原因吗?

最佳答案

我遇到了 Microsoft 代理服务器不能很好地处理 Web 请求的问题。

我不得不求助于强制 HTTP/1.0 并将 KeepAlive 属性设置为 false。

NTLM 身份验证的工作方式会导致偶尔发送正文。

我已将此添加到我的许多网络请求中

protected override WebRequest GetWebRequest(Uri uri)
{
HttpWebRequest webRequest = (HttpWebRequest) base.GetWebRequest(uri);

webRequest.KeepAlive = false;
webRequest.ProtocolVersion=HttpVersion.Version10;
return webRequest;
}

希望这可以帮助!

关于proxy - 缺少代理服务器的 POST 参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5514549/

37 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com