codeigniter 中的最大 URI 长度是多少?
我想知道 codeigniter 中的最大 URI 长度是多少,以及用作控制器函数参数的 URI 段是否计入浏览器 GET 长度限制?我认为大多数浏览器将 GET 参数长度限制为 2000 左右?
目前,如果我的 URI 总长度(包括 https://domain/folder/controller/function/argument) 超过大约 1560 个字符 我收到一条禁止消息。
'禁止,您无权访问此服务器上的 /folder/controller/function/argument'
如果我将字符修剪回 1550~1560 左右,它会再次正常工作。我意识到 1500+ 无论如何都很多了,这就是为什么我在 URI 是否计入 GET 限制时徘徊。
有人遇到过这个问题吗?除了发布所有数据之外还有其他解决方案吗?
顺便说一句:我在配置中使用 URI 协议 AUTO
I'm wandering what the maximum URI length is in codeigniter, and if URI segments being used as arguments to a controller function count towards the browsers GET length limit? I think most browsers cap there GET parameter length to about 2000?
Currently if my total URI length (inc. https://domain/folder/controller/function/argument) exceeds around 1560 characters I get a forbidden message.
'Forbidden You don't have permission to access /folder/controller/function/argument on this server'
If I trim the characters back to under around 1550~1560 it works fine again. I realise 1500+ is alot anyway, which is why I was wandering if URI counts towards the GET limit.
Has anyone experienced this problem? Is there a solution aside from POSTing all data?
BTW: I'm using the URI protocol AUTO in the config
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,整个 URI 或多或少都被限制在特定的长度内。这里已经提到了一些内容: 不同语言中 URL 的最大长度是多少浏览器?
但是,感觉有点奇怪,你需要这么长的 uri。如果附加长度约为 1000 个字符的查询字符串,则数据已达到 1kB。在我看来,查询字符串不是传输数据的正确位置。
As far as I remember the whole URI is limited to a more or less specific length. Something is already mentioned here: What is the maximum length of a URL in different browsers?
However, it feels a little bit curious, that you require such long uris. If you append a query string of around 1000 characters length, thats already 1kB of data. In my oppinion a query string is not the right place to transport data around.