{"record":{"id":"e0b22627c4a29d77","repo":"probelabs/goreplay","slug":"need-both-src-and-target-colon-delimited-ex-a","errorCode":null,"errorMessage":"need both src and target, colon-delimited (ex. /a:/b)","messagePattern":"need both src and target, colon-delimited \\(ex\\. /a:/b\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"http_modifier_settings.go","lineNumber":218,"sourceCode":"\n// Handling of --http-rewrite-url option\ntype urlRewrite struct {\n\tsrc    *regexp.Regexp\n\ttarget []byte\n}\n\n// URLRewriteMap holds regexp and data to modify URL\ntype URLRewriteMap []urlRewrite\n\nfunc (r *URLRewriteMap) String() string {\n\treturn fmt.Sprint(*r)\n}\n\n// Set method to implement flags.Value\nfunc (r *URLRewriteMap) Set(value string) error {\n\tvalArr := strings.SplitN(value, \":\", 2)\n\tif len(valArr) < 2 {\n\t\treturn errors.New(\"need both src and target, colon-delimited (ex. /a:/b)\")\n\t}\n\tregexp, err := regexp.Compile(valArr[0])\n\tif err != nil {\n\t\treturn err\n\t}\n\t*r = append(*r, urlRewrite{src: regexp, target: []byte(valArr[1])})\n\treturn nil\n}\n\n// Handling of --http-rewrite-header option\ntype headerRewrite struct {\n\theader []byte\n\tsrc    *regexp.Regexp\n\ttarget []byte\n}\n\n// HeaderRewriteMap holds regexp and data to rewrite headers\ntype HeaderRewriteMap []headerRewrite","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/probelabs/goreplay/blob/251e45abd242886bb64ff2b2dc98789556b56330/http_modifier_settings.go#L200-L236","documentation":"Flag-value validation error raised by URLRewriteMap.Set (used by --http-rewrite-url) when the argument lacks a colon separating the source regexp from the target path, so no urlRewrite rule can be built.","triggerScenarios":"Thrown at http_modifier_settings.go:218 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide 'src:target', e.g. --http-rewrite-url '/v1/app(.*)/v2/app$1'","Ensure the colon is inside a quoted shell argument","Remember the src part is a regexp compiled right after this check; fix regexp errors separately"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"251e45abd242886bb64ff2b2dc98789556b56330","analyzedAt":"2026-09-02T16:44:11.369Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T21:17:11.164Z"}