{"record":{"id":"a3d350b99d5ae9dc","repo":"probelabs/goreplay","slug":"need-both-header-and-value-colon-delimited-ex-u-a3d350","errorCode":null,"errorMessage":"need both header and value, colon-delimited (ex. user_id:50%)","messagePattern":"need both header and value, colon-delimited \\(ex\\. user_id:50%\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"http_modifier_settings.go","lineNumber":98,"sourceCode":"\n// Handling of --http-allow-header-hash and --http-allow-param-hash options\ntype hashFilter struct {\n\tname    []byte\n\tpercent uint32\n}\n\n// HTTPHashFilters represents a slice of header hash filters\ntype HTTPHashFilters []hashFilter\n\nfunc (h *HTTPHashFilters) String() string {\n\treturn fmt.Sprint(*h)\n}\n\n// Set method to implement flags.Value\nfunc (h *HTTPHashFilters) 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:50%)\")\n\t}\n\n\tf := hashFilter{name: []byte(valArr[0])}\n\n\tval := strings.TrimSpace(valArr[1])\n\n\tif strings.Contains(val, \"%\") {\n\t\tp, _ := strconv.ParseInt(val[:len(val)-1], 0, 0)\n\t\tf.percent = uint32(p)\n\t} else if strings.Contains(val, \"/\") {\n\t\t// DEPRECATED format\n\t\tvar num, den uint64\n\n\t\tfracArr := strings.Split(val, \"/\")\n\t\tnum, _ = strconv.ParseUint(fracArr[0], 10, 64)\n\t\tden, _ = strconv.ParseUint(fracArr[1], 10, 64)\n\n\t\tf.percent = uint32((float64(num) / float64(den)) * 100)","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/probelabs/goreplay/blob/251e45abd242886bb64ff2b2dc98789556b56330/http_modifier_settings.go#L80-L116","documentation":"Flag-value validation error raised by HTTPHashFilters.Set (used by --http-allow-header-hash/--http-allow-param-hash) when the argument lacks a colon separating the header/param name from its hash percentage, so no hashFilter can be constructed.","triggerScenarios":"Thrown at http_modifier_settings.go:98 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Supply both parts separated by a colon, e.g. --http-allow-header-hash 'user_id:50%'","If you meant a percentage-only value, remember the header name must come first","Verify the value reaches Set intact (shell quoting, config templating)"],"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"}