【问题标题】:How can I set the Undertow MAX_ENTITY_SIZE in WildFly如何在 WildFly 中设置 Undertow MAX_ENTITY_SIZE
【发布时间】:2020-12-20 06:17:36
【问题描述】:

我想将文件作为 InputStream 正文直接上传到 JAX-RS POST 请求。但是body默认限制为10MB,对于我的一些文件来说太小了。我找到了一个配置选项MAX_ENTITY_SIZE,但是如何在 WildFly 中设置它们?我在 jboss-cli 中没有找到任何东西。

【问题讨论】:

    标签: file-upload jax-rs wildfly undertow


    【解决方案1】:

    使用 jboss-cli.sh,您可以执行以下操作:

    /subsystem=undertow/server=default-server/https-listener=https/:write-attribute(name=max-post-size,value=104857600)
    

    (假设 HTTPS)其中 104857600 现在是 100MB 左右。

    这会将相应的standalone.xml 修改为:

    <https-listener name="https" socket-binding="https" max-post-size="104857600" security-realm="ApplicationRealm" enable-http2="true"/>
    

    【讨论】:

    • 完美运行。我在文档中没有找到任何内容,因为我搜索了 MAX_ENTITY_SIZE... 如果它适用于所有 http 方法(例如 PUT),我认为将其命名为 max-post-size 不是一个好主意。顺便说一句:我必须使用http 监听器(没有s),例如:/subsystem=undertow/server=default-server/http-listener=default:write-attribute(name=max-post-size,value=104857600L)
    猜你喜欢
    • 1970-01-01
    • 2021-05-19
    • 2018-07-17
    • 1970-01-01
    • 2014-10-26
    • 2019-05-28
    • 2014-11-20
    • 2015-05-31
    • 2021-05-02
    相关资源
    最近更新 更多