mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
Jackson 2.15+ defaults StreamReadConstraints.maxStringLength to 20 MB, blocking Lambda CreateFunction when the base64-encoded ZipFile exceeds that limit. AWS allows up to 50 MB direct upload (~67 MB base64). Add an ObjectMapperCustomizer that raises the limit to 100 MB, and an integration test that sends a >20 MB base64 payload to verify it works.
This commit is contained in:
2 files changed
+77
No files matched your search
@@ -0,0 +1,25 @@
|
||||
package io.github.hectorvent.floci.core.common;
|
||||
|
||||
import com.fasterxml.jackson.core.StreamReadConstraints;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import io.quarkus.jackson.ObjectMapperCustomizer;
|
||||
import jakarta.inject.Singleton;
|
||||
|
||||
/**
|
||||
* Raises this application's Jackson string-length limit so that large inline payloads
|
||||
* (e.g. base64-encoded Lambda ZipFile up to ~67 MB) are accepted.
|
||||
* AWS allows 50 MB direct upload; base64 expands that by ~33%.
|
||||
*/
|
||||
@Singleton
|
||||
public class JacksonConfig implements ObjectMapperCustomizer {
|
||||
|
||||
private static final int MAX_STRING_LENGTH = 100_000_000; // 100 MB
|
||||
|
||||
@Override
|
||||
public void customize(ObjectMapper mapper) {
|
||||
mapper.getFactory().setStreamReadConstraints(
|
||||
StreamReadConstraints.builder()
|
||||
.maxStringLength(MAX_STRING_LENGTH)
|
||||
.build());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user