{"record":{"id":"d72017b841e4097c","repo":"probelabs/goreplay","slug":"need-both-header-and-value-colon-delimited-ex-u","errorCode":null,"errorMessage":"need both header and value, colon-delimited (ex. user_id:^169$)","messagePattern":"need both header and value, colon-delimited \\(ex\\. user_id:\\^169\\$\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"http_modifier_settings.go","lineNumber":44,"sourceCode":"\n// Handling of --http-allow-header, --http-disallow-header options\ntype headerFilter struct {\n\tname   []byte\n\tregexp *regexp.Regexp\n}\n\n// HTTPHeaderFilters holds list of headers and their regexps\ntype HTTPHeaderFilters []headerFilter\n\nfunc (h *HTTPHeaderFilters) String() string {\n\treturn fmt.Sprint(*h)\n}\n\n// Set method to implement flags.Value\nfunc (h *HTTPHeaderFilters) Set(value string) error {\n\tvalArr := strings.SplitN(value, \":\", 2)\n\tif len(valArr) < 2 {\n\t\treturn errors.New(\"need both header and value, colon-delimited (ex. user_id:^169$)\")\n\t}\n\tval := strings.TrimSpace(valArr[1])\n\tr, err := regexp.Compile(val)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t*h = append(*h, headerFilter{name: []byte(valArr[0]), regexp: r})\n\n\treturn nil\n}\n\n// Handling of --http-basic-auth-filter option\ntype basicAuthFilter struct {\n\tregexp *regexp.Regexp\n}\n\n// HTTPHeaderBasicAuthFilters holds list of regxp to match basic Auth header values","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/probelabs/goreplay/blob/251e45abd242886bb64ff2b2dc98789556b56330/http_modifier_settings.go#L26-L62","documentation":"Flag-value validation error raised by HTTPHeaderFilters.Set (used by --http-allow-header/--http-disallow-header) when the user's flag argument has no colon, so it cannot be split into a header name and a regexp value; such an input can never become a headerFilter.","triggerScenarios":"Thrown at http_modifier_settings.go:44 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the flag as Header:Value with a colon, e.g. --http-allow-header 'user_id:^169$'","Quote the argument in the shell so the colon is not eaten by the tool wrapping the command","Check the flag parsing call site for a splitter that strips colons before Set receives the value"],"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"}