Skip to content

Commit

Permalink
Set the maximum length of the content at the session layer
Browse files Browse the repository at this point in the history
  • Loading branch information
taeyeon-Kim committed Sep 17, 2023
1 parent c7ab774 commit 2b2a212
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,16 @@ class ArmeriaConfiguration(
@Bean
fun armeriaServiceInitializer(tomcatService: TomcatService): ArmeriaServerConfigurator {
return ArmeriaServerConfigurator { serviceBuilder: ServerBuilder ->
val maxMessageSize = maxMessageSize.toBytes().toInt()
serviceBuilder.service("prefix:/", tomcatService)
.service(GrpcService.builder()
.addService(grpcAgentController)
.addExceptionMapping(IllegalArgumentException::class.java, Status.INVALID_ARGUMENT)
.addExceptionMapping(LicenseKeyNotFoundException::class.java, Status.UNAUTHENTICATED)
.maxRequestMessageLength(maxMessageSize.toBytes().toInt())
.maxRequestMessageLength(maxMessageSize)
.build()
)
.maxRequestLength(maxMessageSize.toLong())
}
}
}

0 comments on commit 2b2a212

Please sign in to comment.