Support body rewrite

This commit is contained in:
Bel LaPointe
2019-04-10 10:47:30 -06:00
parent f72ecc5e53
commit f58f6f7cf3
4 changed files with 71 additions and 11 deletions

View File

@@ -47,6 +47,7 @@ type fileConf struct {
func Init() error {
log.SetFlags(log.Ldate | log.Ltime | log.Llongfile)
log.SetFlags(log.Ltime | log.Lshortfile)
if err := fromFile(); err != nil {
return err
}
@@ -120,7 +121,7 @@ func fromFlags() error {
binds = append(binds, addFlag(flagRate, "100", "rate limit per second"))
binds = append(binds, addFlag(flagBurst, "100", "rate limit burst"))
binds = append(binds, addFlag(flagTimeout, "30", "seconds to wait for limiter"))
binds = append(binds, addFlag(flagRewrites, "", "comma-separated regex:v to rewrite in response bodies"))
binds = append(binds, addFlag(flagRewrites, "", "comma-separated from:replace:replacement to rewrite in response bodies"))
flag.Parse()
for _, bind := range binds {