【问题标题】:Wildfly 11 http to https redirecting losing http methodWildfly 11 http 到 https 重定向丢失 http 方法
【发布时间】:2018-11-07 23:34:18
【问题描述】:

我使用重写过滤器配置了我的 wildfly 11 安装,以从 http 重定向到 https。如那里所述: Redirect http requests to https in wildfly 10

<filters>
   <rewrite name="http-to-https" redirect="true" target="https://%v:443%U"/>
</filters>

<filter-ref name="http-to-https" predicate="equals(%p,80)"/>

这非常适合 GET 请求,但如果我尝试 POST 请求,我会得到

405 Method not allowed

有人知道如何配置重写过滤器以使用消息类型(%m,http://undertow.io/undertow-docs/undertow-docs-1.4.0/index.html

谢谢!

【问题讨论】:

    标签: https wildfly wildfly-11


    【解决方案1】:

    POST 重定向没有得到很好的支持。请参阅this postthis one 作为处理此问题的示例。

    对于 Spring,this post 显示了一种返回不同于 301 的 HTTP 状态的方法。

    简短的回答是您需要使用不同的 HTTP 响应代码(308 永久重定向)。最后一个答案显示了一种方法。

    【讨论】:

    • 谢谢。我们决定将此视为禁用 http POST 请求的功能:D
    猜你喜欢
    • 2019-01-08
    • 2018-03-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-20
    • 2019-02-23
    • 1970-01-01
    相关资源
    最近更新 更多