Skip to content

Commit

Permalink
Attempt at adding missing parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
RodoMa92 authored Nov 24, 2023
1 parent 1e7a2d4 commit dbf9c7a
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ spec:
plugin-rewritebody:
lastModified: "true"
rewrites:
{{- range $index, $rewriteResponseHeader := $middlewareData.headers }}
- regex: {{ $rewriteResponseHeader.regex | quote }}
replacement: {{ $rewriteResponseHeader.replacement | quote }}
{{- range $index, $rewriteResponseBody := $middlewareData.headers }}
- regex: {{ $rewriteResponseBody.regex | quote }}
replacement: {{ $rewriteResponseBody.replacement | quote }}
{{- end }}
{{- end -}}
5 changes: 5 additions & 0 deletions charts/enterprise/traefik/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,11 @@ middlewares:
# - name: "Date"
# regex: "^[^,]+,\\s*(.+)$"
# replacement: "$1"
rewriteResponseBody: []
# - name: rewriteResponseBodyName
# headers:
# - regex = "foo"
# replacement = "bar"
customFrameOptionsValue: []
# - name: customFrameOptionsValueExample
# value: "SAMEORIGIN"
Expand Down
41 changes: 41 additions & 0 deletions templates/questions/traefik/rewriteResponseBodyMiddleware.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
- variable: rewriteResponseBody
label: Rewrite Response Body
schema:
type: list
default: []
items:
- variable: rewriteResponseBodyEntry
label: ""
schema:
additional_attrs: true
type: dict
attrs:
- variable: name
label: Name
schema:
type: string
required: true
- variable: headers
label: HTML body sections to replace
schema:
type: list
default: []
items:
- variable: bodyEntry
label: ""
schema:
additional_attrs: true
type: dict
attrs:
- variable: regex
label: Regex
description: The value of the HTML code to match. Accepts regex expression.
schema:
type: string
default: ""
- variable: replacement
label: Replacement Regex
description: The replacement HTML code to substitute. Accepts regex expression.
schema:
type: string
default: ""

0 comments on commit dbf9c7a

Please sign in to comment.