{"record":{"id":"842a2bfb16ba8c3d","repo":"XX-net/XX-Net","slug":"body-len-d-s-s","errorCode":null,"errorMessage":"body len:%d %s %s","messagePattern":"body len:(.+?) (.+?) (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"code/default/gae_proxy/local/gae_handler.py","lineNumber":239,"sourceCode":"\ndef return_fail_message(wfile):\n    html = generate_message_html(\n        '504 GAEProxy Proxy Time out', '连接超时，先休息一会再来！')\n    send_response(wfile, 504, body=utils.to_bytes(html))\n    return\n\n\ndef pack_request(method, url, headers, body, timeout):\n    headers = dict(headers)\n    if isinstance(body, bytes) and body:\n        if len(body) < 10 * 1024 * 1024 and b'Content-Encoding' not in headers:\n            # 可以压缩\n            zbody = deflate(body)\n            if len(zbody) < len(body):\n                body = zbody\n                headers[b'Content-Encoding'] = b'deflate'\n        if len(body) > 10 * 1024 * 1024:\n            xlog.warn(\"body len:%d %s %s\", len(body), method, url)\n        headers[b'Content-Length'] = utils.to_bytes(str(len(body)))\n\n    # GAE don't allow set `Host` header\n    if b'Host' in headers:\n        del headers[b'Host']\n\n    kwargs = {}\n    # gae 用的参数\n    if front.config.GAE_PASSWORD:\n        kwargs[b'password'] = front.config.GAE_PASSWORD\n\n    # kwargs['options'] =\n    kwargs[b'validate'] = front.config.GAE_VALIDATE\n    if url.endswith(b\".js\"):\n        kwargs[b'maxsize'] = front.config.JS_MAXSIZE\n    else:\n        kwargs[b'maxsize'] = front.config.AUTORANGE_MAXSIZE\n    kwargs[b'timeout'] = str(timeout)","sourceCodeStart":221,"sourceCodeEnd":257,"githubUrl":"https://github.com/XX-net/XX-Net/blob/cfa5bc17b67676e467f37ec50766127e0ab5f0aa/code/default/gae_proxy/local/gae_handler.py#L221-L257","documentation":"pack_request warns whenever the (possibly deflated) request body exceeds 10 MB before being forwarded to GAE. It is informational size tracking, not a failure — the request is still sent with the computed Content-Length.","triggerScenarios":"A POST/PUT whose body, even after deflate compression, is larger than 10*1024*1024 bytes, e.g. large uploads through the proxy.","commonSituations":"Uploading big files via the local proxy; App Engine request limits (~32MB, often lower) may reject such requests upstream.","solutions":["Expect upstream GAE/App Engine size limits to reject the upload; upload directly or via another channel","Compress/large-file split on the application side","Ignore if you knowingly upload large bodies — the log is informational"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if len(body) > 10 * 1024 * 1024:\n    raise ValueError('body too large for GAE upload path')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Upload large files outside the GAE proxy path","Compress payloads before sending"],"tags":["large-body","upload","gae-proxy"],"backgroundTag":"request-body-too-large","analyzedSha":"cfa5bc17b67676e467f37ec50766127e0ab5f0aa","analyzedAt":"2026-08-27T19:28:28.225Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}