Commit graph

6 commits

Author SHA1 Message Date
Ondřej Benkovský
c2dbb7141a
add golangci-lint linter (#5499) 2022-07-10 11:06:33 -07:00
Uwe Krueger
40edf1e566
plugin/rewrite: streamline the ResponseRule handling. (#4473)
* plugin/rewrite: streamline the ResponseRule handling.

The functionality of a response rule is now completely encapsulated behind
a `ResponseRule` interface. This significantly simplifies the complete
processing flow, it enables more flexible response handling and it is possible
to eliminate lots of state flags, ifs and switches.

Based on the new flexibility the pull request also enables to support a
response name rewrite for all name rewrite types.
To be compatible, an explicit `answer auto` option is added to support
a best effort response rewrite (name and value).
Additionally now all name rewrite rules support additional name and value
reponse rewrite options.

Using this feature it is also possible now to rewrite a complete sub domain
hierarchy to a single domain name combined with a correct rewrite (#2389).

Signed-off-by: Uwe Krueger <uwe.krueger@sap.com>

* revert policy

Signed-off-by: Uwe Krueger <uwe.krueger@sap.com>

Co-authored-by: Miek Gieben <miek@miek.nl>
2021-05-04 10:05:45 +02:00
Daniel Garcia
4a3f5cc41e Use Trim(Prefix/Suffix) instead of Trim(Left/Right) in rewrite prefix plugin (#2364) (#2372) 2018-12-06 22:10:46 +00:00
Daniel Garcia
f51c110511 Use TrimPrefix instead of TrimLeft in rewrite prefix plugin (#2364) (#2370) 2018-12-06 21:02:07 +00:00
Paul G
a9ce35ae4e
plugin/rewrite: add closing dot for suffix rewrite rule (#2070)
* add closing dot for suffix rewrite rule
* improve rule syntax checks

Resolves: #1881
2018-10-23 16:59:59 -04:00
Miek Gieben
d9b9a955ba plugin/rewrite: prevent illegal names (#1972)
Log and returns an error when the name rewrite creates a name that is
illegal. Add test in name_test.go to see if an error is returned.

Possible followup could be the only check this if a name-rewrite is
done.

Fixes: #1638

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-07-13 09:32:07 -04:00