瘦服务器 QUERY_STRING 的长度超过 (1024 * 10) 允许的长度 [英] Thin server QUERY_STRING is longer than the (1024 * 10) allowed length

查看:82
本文介绍了瘦服务器 QUERY_STRING 的长度超过 (1024 * 10) 允许的长度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用 thinpumaunicorn 网络增加 QUERY_STRING 的最大允许值Rails 中的服务器?我正在尝试向我的 Rails API 发出超出限制的 POST 请求,只需要增加服务器的最大阈值

How can I increase the maximum allowed value for QUERY_STRING using either thin, puma, or unicorn web servers in Rails? I'm attempting to make a POST request to my Rails API that exceeds the limit, and just need to increase the server's maximum threshold

POST 特定错误:无效请求:HTTP 元素 QUERY_STRING 长度超过 (1024 * 10) 允许长度.

我只在另一个地方遇到过这个问题(HTTP 查询使用瘦 Web 服务器的字符串长度),我不太明白答案(具体来说,在哪里可以找到要在该答案中编辑的 C 文件?)

I only came across this question in one other place (HTTP query string length with thin web server) and I couldn't quite make sense of the answer (specifically, where does one find the C file to edit in that answer?)

推荐答案

你会在类似 ~/.rvm/gems/ruby-2.2.0/gems/thin-1.6.4/ext/的地方找到 Thin.c瘦解析器

You'll find thin.c in something like ~/.rvm/gems/ruby-2.2.0/gems/thin-1.6.4/ext/thin_parser

你会想要改变

DEF_MAX_LENGTH(REQUEST_URI, 1024 * 12); 
...
DEF_MAX_LENGTH(QUERY_STRING, (1024 * 10));

在同一个文件夹中,您只需要使用 Makefile 重新加载 Thin_parser.so,并将之前的 Thin_parser.so 替换为 ~/.rvm/gems/ruby-2.2.0/gems/thin 中的新文件-1.6.4/lib(好像是Makefile没有自己做)

in this same folder you just need to use the Makefile to reload the thin_parser.so, and to replace the previous thin_parser.so by the new one in ~/.rvm/gems/ruby-2.2.0/gems/thin-1.6.4/lib (seems like the Makefile is not doing it itself)

make clean && make && cp thin_parser.so ../../lib/

我就是这样做的,希望能帮到你

I just made it work that way, hope it helps

这篇关于瘦服务器 QUERY_STRING 的长度超过 (1024 * 10) 允许的长度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆