[ci skip] Fix rewrite-body plugin corrupting compressed responses
The packruler/rewrite-body plugin (used for rybbit analytics injection) fails to decompress gzip responses with "flate: corrupt input before offset 5", corrupting the response body. This broke HA Companion app's external_auth flow and WebSocket connections on ha-sofia. Fix: add a strip-accept-encoding middleware that removes Accept-Encoding from requests when rybbit is active, forcing backends to send uncompressed responses that the plugin can safely process. Also add extra_middlewares variable to reverse_proxy factory for extensibility.
This commit is contained in:
parent
036ec06256
commit
f03b8a055b
3 changed files with 31 additions and 2 deletions
|
|
@ -218,3 +218,26 @@ resource "kubernetes_manifest" "middleware_immich_rate_limit" {
|
|||
|
||||
depends_on = [helm_release.traefik]
|
||||
}
|
||||
|
||||
# Strip Accept-Encoding header so backends send uncompressed responses.
|
||||
# Used alongside rewrite-body plugin (rybbit analytics) which fails to
|
||||
# decompress certain gzip responses (flate: corrupt input before offset 5).
|
||||
resource "kubernetes_manifest" "middleware_strip_accept_encoding" {
|
||||
manifest = {
|
||||
apiVersion = "traefik.io/v1alpha1"
|
||||
kind = "Middleware"
|
||||
metadata = {
|
||||
name = "strip-accept-encoding"
|
||||
namespace = kubernetes_namespace.traefik.metadata[0].name
|
||||
}
|
||||
spec = {
|
||||
headers = {
|
||||
customRequestHeaders = {
|
||||
"Accept-Encoding" = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
depends_on = [helm_release.traefik]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue