3

I want to upload a file using ZIO HTTP, but it gives 413 code, the payload is too large.
I can't figure out how to change the configuration of the underlying Netty server to fix the issue.

Any help would be appreciated.

greybeard
  • 2,249
  • 8
  • 30
  • 66
RB_
  • 1,195
  • 15
  • 35
  • 2
    Have you tried setting with `Server.maxRequestSize`? https://github.com/dream11/zio-http/blob/1b1640f21535da6cf4243d7bc93c439896c517fd/zio-http/src/main/scala/zhttp/service/Server.scala#L69 – yangzai Dec 25 '21 at 07:31
  • @yangzai, yes I have figured it out by looking at the code. Its just not documented anywhere, and reading the source code is normally the last thing I am doing. – RB_ Dec 25 '21 at 19:30
  • 1
    Created this issue here — https://github.com/dream11/zio-http/issues/700 – tusharmath Dec 27 '21 at 12:48

1 Answers1

6

After looking at the source code I have figured it out:

private val server =
    Server.port(8090) ++
    Server.maxRequestSize(maxRequestSize) ++
    Server.app(routes)
RB_
  • 1,195
  • 15
  • 35