不工作?-6ren"> 不工作?-我有一个很长的查询字符串值需要传入(我理解这本身就是一个有问题的做法),但我无法让它在我的 Appharbor 上生效。应用实例。 在本地,我对我的 web.config 进行了此更改并确认有问题的 -6ren">
gpt4 book ai didi

web-config - AppHarbor - 为什么我的 不工作?

转载 作者:行者123 更新时间:2023-12-01 23:18:51 25 4
gpt4 key购买 nike

我有一个很长的查询字符串值需要传入(我理解这本身就是一个有问题的做法),但我无法让它在我的 Appharbor 上生效。应用实例。

在本地,我对我的 web.config 进行了此更改并确认有问题的 URL 在本地有效:

<httpRuntime maxQueryStringLength="2097151"/>

并确保它存在于由我的 Web.Release.config 转换后的结果 web.config 中。就是说,当我推送到 AppHarbor 时,转换应该会恢复...但我仍然收到此异常:

The length of the query string for this request exceeds the configured maxQueryStringLength value.

堆栈跟踪:

at System.Web.HttpRequest.ValidateInputIfRequiredByConfig()
at System.Web.HttpApplication.PipelineStepManager.ValidateHelper(HttpContext context)

有什么想法吗?感谢您的帮助。

最佳答案

我最初的测试是针对 Cassini(VS 2010 的内置网络服务器)完成的。我在本地推送到 IIS 7.5 并发现此错误:

HTTP Error 404.15 - Not Found
The request filtering module is configured to deny a request where the query string is too long.

出现是因为我没有在 <system.webServer> 中指定 maxQueryLength我的 web.config 部分以及 <httpRuntime> .所以答案是同时指定 <system.web><system.webServer>部分:

<system.web>
<httpRuntime maxQueryStringLength="2097151"/>
</system.web>

然后:

<system.webServer>
<security>
<requestFiltering>
<requestLimits maxQueryString="2097151"/>
</requestFiltering>
</security>
</system.webServer>

当我将这个版本的配置推送到 AppHarbor 时,一切都很好。希望这会有所帮助。

关于web-config - AppHarbor - 为什么我的 <httpRuntime maxRequestQueryStringLength ="XXXX"/> 不工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8933820/

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