echocat/caddy-filter

Headers will not be set if rules only applies partially

stp-ip opened this issue · 1 comments

Seems like filter is preventing the redirect and rewriting it to a page like:

<a href="https://www.example.com">Found</a>.

https://www.example.com is the page to redirect to using:

Works:

:8080 {
  redir / https://www.example.com 302
}

Interferes:

:8080 {
  redir / https://www.example.com 302
  filter rule {
    content_type "text/html.*"
    search_pattern "<body>"
    replacement "<body><div style=\"background-color: #000; padding: 10px; margin-bottom: 5px; color: #fff; text-align: center;\"><h1>Some new heading.</h1></div>"
  }
}

Test_redir with integrationTest.Test_redir.conf describes the problem and they are now fixed. Thank for your input.