Skip to content

invalid rule type #107

@Elegant996

Description

@Elegant996

Experiencing a really weird issue where traefik reports an invalid rule type regardless of the rule. Our existing middleware can be seen below but please note that simplifying this down to first rule also causes the issue. Something is not sitting well with https://github.com/tomMoulard/htransformation/blob/bcfcb3b2979ac73958aad92b37cbe5680346bab9/htransformation.go#L52C21-L52C35.

apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
  name: cloudflare-headers
spec:
  plugin:
    headerTransformation:
      Rules:
        - Rule:
            Name: 'Set X-Forwarded-For'
            Header: 'X-Forwarded-For'
            HeaderPrefix: "^"
            Sep: ','
            Values:
              - '^Cf-Connecting-IP'
            Type: 'Join'
        - Rule:
            Name: 'Set X-Real-IP'
            Header: 'X-Real-IP'
            HeaderPrefix: "^"
            Value: '^Cf-Connecting-IP'
            Type: 'Set'
        - Rule:
            Name: 'Set X-Forwarded-Proto'
            Header: 'X-Forwarded-Proto'
            HeaderPrefix: "^"
            Value: '^Cf-Visitor'
            Type: 'Set'
        - Rule:
            Name: 'Rewrite X-Forwarded-Proto'
            Header: 'X-Forwarded-Proto'
            Value: '{ \"scheme\":\"$1\"}'
            ValueReplace: '$1'
            Type: 'RewriteValueRule'

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions