【问题标题】:413 Request is larger than 20 MB or headers are too large. websolr413 请求大于 20 MB 或标头太大。网络解决方案
【发布时间】:2021-05-06 16:34:35
【问题描述】:

在 SOLR 上获取 GET 请求错误请求大于 20 MB 或标头太大。请缩小您的请求并重试,或联系 support@websolr.com 并提供您的请求样本以获得进一步帮助。

下面的示例请求: removing curl request due to security reason 回应:

HTTP/2 413
date: Thu, 06 May 2021 16:25:31 GMT
content-type: application/json
content-length: 218

{"code":413,"message":"Request is larger than 20 MB or headers are too large. Please reduce the size of your request and try again, or contact support@websolr.com with a sample of your request for further assistance."}

我不确定请求如何超过 20MB。也不发送任何标题。

【问题讨论】:

  • This answer 说 Apache 有 a server URL length limit of approximately 4,000 characters, after which Apache produces a "413 Entity Too Large" error 您的查询字符串超过 8,000 个字符,所以这可能导致错误?
  • 查询 Solr 时可以使用 HTTP POST(而不是 GET)。这将允许您绕过 4K 限制。

标签: solr sunspot sunspot-rails sunspot-solr websolr


【解决方案1】:

此处提供 Websolr 支持。当您在 curl 命令中传递这些查询参数时,它们是 Request-Line 标头的一部分。该行中有超过 5900 个字符,这是触发 HTTP 413 的原因。

作为一种解决方法,只需使用 POST:

curl -i "removing data due to security reason"

【讨论】:

  • 会检查是否允许使用POST请求
猜你喜欢
  • 2017-03-05
  • 2021-03-15
  • 1970-01-01
  • 2014-12-30
  • 2014-12-23
  • 1970-01-01
  • 2012-09-23
  • 2015-10-04
相关资源
最近更新 更多