zeromicro / go-zero

A cloud-native Go microservices framework with cli tool for productivity.
https://go-zero.dev
MIT License
29.34k stars 3.96k forks source link

maxBytes invalid #4419

Closed strong-xiaoge closed 1 month ago

strong-xiaoge commented 1 month ago

Describe the bug "In the API file, I set maxBytes for the router group to 1,368,709,120, but after generating the code and running it, the actual maxBytes is still the default value."

  1. The code is

    server.AddRoutes(
    []rest.Route{
       {
          Method:  http.MethodPost,
          Path:    "/xxx/xxx",
          Handler: aioxiekang.Upload(serverCtx),
       },
    },
    rest.WithPrefix("/xxx/xxx"),
    rest.WithMaxBytes(1368709120),
    )
  2. The error is

    request entity too large, limit is 1048576, but got 1448382, rejected with code 413

Environments (please complete the following information):

zhoushuguang commented 1 month ago

Can't reproduce your problem, from the generated code there seems to be no problem, can you provide the api file?

strong-xiaoge commented 1 month ago

It's already solved because I added the prefix prefix