{"record":{"id":"373111beee9bba22","repo":"projectdiscovery/nuclei","slug":"errrebuildurl","errorCode":"ErrRebuildURL","errorMessage":"could not rebuild request URL: %w","messagePattern":"could not rebuild request URL: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/protocols/http/httpclientpool/clientpool.go","lineNumber":599,"sourceCode":"}\n\nfunc checkMaxRedirects(req *http.Request, via []*http.Request, maxRedirects int) error {\n\tif maxRedirects == 0 {\n\t\tif len(via) > defaultMaxRedirects {\n\t\t\treturn http.ErrUseLastResponse\n\t\t}\n\t\treturn nil\n\t}\n\n\tif len(via) > maxRedirects {\n\t\treturn http.ErrUseLastResponse\n\t}\n\n\t// NOTE(dwisiswant0): rebuild request URL. See #5900.\n\tif u := req.URL.String(); !isURLEncoded(u) {\n\t\tparsed, err := urlutil.Parse(u)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"%w: %w\", ErrRebuildURL, err)\n\t\t}\n\n\t\treq.URL = parsed.URL\n\t}\n\n\treturn nil\n}\n\n// isURLEncoded is an helper function to check if the URL is already encoded\n//\n// NOTE(dwisiswant0): shall we move this under `projectdiscovery/utils/urlutil`?\nfunc isURLEncoded(s string) bool {\n\tdecoded, err := url.QueryUnescape(s)\n\tif err != nil {\n\t\t// If decoding fails, it may indicate a malformed URL/invalid encoding.\n\t\treturn false\n\t}\n","sourceCodeStart":581,"sourceCodeEnd":617,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/pkg/protocols/http/httpclientpool/clientpool.go#L581-L617","documentation":"Error \"could not rebuild request URL: %w\" thrown in projectdiscovery/nuclei.","triggerScenarios":"Thrown at pkg/protocols/http/httpclientpool/clientpool.go:599 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}