From 269769755219652dd1d89b11a5f38bea252dbcc5 Mon Sep 17 00:00:00 2001 From: ginuerzh Date: Fri, 19 Jul 2024 20:42:33 +0800 Subject: [PATCH] add rewrite body http node setting --- chain/node.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/chain/node.go b/chain/node.go index ca97163..6c555da 100644 --- a/chain/node.go +++ b/chain/node.go @@ -22,11 +22,18 @@ type HTTPURLRewriteSetting struct { Replacement string } +type HTTPBodyRewriteSettings struct { + Type string + Pattern *regexp.Regexp + Replacement []byte +} + type HTTPNodeSettings struct { - Host string - Header map[string]string - Auther auth.Authenticator - Rewrite []HTTPURLRewriteSetting + Host string + Header map[string]string + Auther auth.Authenticator + RewriteURL []HTTPURLRewriteSetting + RewriteBody []HTTPBodyRewriteSettings } type TLSNodeSettings struct {