首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >增加Spring Cloud Gateway RequestBodySize

增加Spring Cloud Gateway RequestBodySize
EN

Stack Overflow用户
提问于 2021-01-27 06:14:17
回答 1查看 273关注 0票数 0

当发布通过Spring Cloud Gateway路由的内容时,我当前收到的413请求实体太大。当请求正文不超过3MB左右时,它就会起作用。

这是我的application.yml (已擦除)

代码语言:javascript
复制
spring:
  profiles:
    active: prod
  main:
    allow-bean-definition-overriding: true
  application:
    name: my-awesome-gateway
  cloud:
    gateway:
      default-filters:
        - DedupeResponseHeader=Access-Control-Allow-Origin Access-Control-Allow-Credentials, RETAIN_UNIQUE
      routes:
        - id: my-service
          uri: https://myservicesdomainname
          predicates:
            - Path=/service/**
          filters:
            - StripPrefix=1
            - UserInfoFilter
            - name: Hystrix
              args:
                name: fallbackCommand
                fallbackUri: forward:/fallback/first
            - name: RequestSize
              args:
                maxSize: 500000000 #***** Here is my attempt to increase the size
      httpclient:
        connect-timeout: 10000
        response-timeout: 20000

这是我获取RequestSize/args/maxSize的链接

代码语言:javascript
复制
https://cloud.spring.io/spring-cloud-static/spring-cloud-gateway/2.1.0.RELEASE/multi/multi__gatewayfilter_factories.html#_requestsize_gatewayfilter_factory

编辑:问题出在Kubernetes入口控制器上。我修复了那里的问题,现在它正在工作

EN

回答 1

Stack Overflow用户

发布于 2021-09-28 09:51:27

它只比较指定限制的Content-Length请求头部,并立即拒绝,即不计算上传的字节

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65910046

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档