{"record":{"id":"49e4cd1dc5f27c32","repo":"router-for-me/CLIProxyAPI","slug":"response-exceeds-maximum-allowed-size-of-d-bytes","errorCode":null,"errorMessage":"response exceeds maximum allowed size of %d bytes","messagePattern":"response exceeds maximum allowed size of (.+?) bytes","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/httpfetch/httpfetch.go","lineNumber":59,"sourceCode":"\t\t\tlog.WithError(errClose).Debug(\"failed to close response body\")\n\t\t}\n\t}()\n\n\tif resp.StatusCode < http.StatusOK || resp.StatusCode >= http.StatusMultipleChoices {\n\t\tbody, _ := io.ReadAll(io.LimitReader(resp.Body, 4096))\n\t\treturn nil, fmt.Errorf(\"unexpected status %d: %s\", resp.StatusCode, strings.TrimSpace(string(body)))\n\t}\n\n\treader := io.Reader(resp.Body)\n\tif maxSize > 0 {\n\t\treader = io.LimitReader(resp.Body, maxSize+1)\n\t}\n\tdata, errRead := io.ReadAll(reader)\n\tif errRead != nil {\n\t\treturn nil, fmt.Errorf(\"read response: %w\", errRead)\n\t}\n\tif maxSize > 0 && int64(len(data)) > maxSize {\n\t\treturn nil, fmt.Errorf(\"response exceeds maximum allowed size of %d bytes\", maxSize)\n\t}\n\treturn data, nil\n}\n","sourceCodeStart":41,"sourceCodeEnd":63,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/httpfetch/httpfetch.go#L41-L63","documentation":"Error \"response exceeds maximum allowed size of %d bytes\" thrown in router-for-me/CLIProxyAPI.","triggerScenarios":"Thrown at internal/httpfetch/httpfetch.go:59 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Request a smaller resource or raise the maximum allowed size if appropriate.","Verify the upstream is returning the expected content and not an error page."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"78f0c4079e3e6273d65d03b5549cffc898703264","analyzedAt":"2026-08-15T12:26:37.444Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}