diff --git a/hijack.go b/hijack.go index e84cedf4..ea0db355 100644 --- a/hijack.go +++ b/hijack.go @@ -117,7 +117,10 @@ func (r *HijackRouter) Add(pattern string, resourceType proto.NetworkResourceTyp ResourceType: resourceType, }) - reg := regexp.MustCompile(proto.PatternToReg(pattern)) + reg, err := regexp.Compile(proto.PatternToReg(pattern)) + if err != nil { + return err + } r.handlers = append(r.handlers, &hijackHandler{ pattern: pattern,