fix nil pointer deref

This commit is contained in:
Kevin Pham
2023-11-18 18:13:46 -06:00
parent f6341f2c3e
commit 98fa53287b
2 changed files with 35 additions and 27 deletions

View File

@@ -39,19 +39,21 @@ type ProxyOptions struct {
}
func NewProxySiteHandler(opts *ProxyOptions) fiber.Handler {
var rs ruleset.RuleSet
if opts.RulesetPath != "" {
r, err := ruleset.NewRuleset(opts.RulesetPath)
if err != nil {
panic(err)
/*
var rs ruleset.RuleSet
if opts.RulesetPath != "" {
r, err := ruleset.NewRuleset(opts.RulesetPath)
if err != nil {
panic(err)
}
rs = r
}
rs = r
}
*/
return func(c *fiber.Ctx) error {
return proxychain.NewProxyChain().
SetCtx(c).
AddRuleset(&rs).
//AddRuleset(&rs).
SetRequestModifications(
rqm.BlockOutgoingCookies(),
).