|
|
@ -40,9 +40,13 @@ public class SopGatewayEnvironmentPostProcessor implements EnvironmentPostProces |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void initMemSize(Properties properties) { |
|
|
|
private void initMemSize(Properties properties) { |
|
|
|
String size = properties.getProperty("spring.servlet.multipart.max-file-size", "10M"); |
|
|
|
String maxFileSizeKey = "spring.servlet.multipart.max-file-size"; |
|
|
|
DataSize dataSize = DataSize.parse(size); |
|
|
|
String maxMemSizeKey = "spring.codec.max-in-memory-size"; |
|
|
|
properties.putIfAbsent("spring.codec.max-in-memory-size", dataSize.toBytes()); |
|
|
|
String defaultSize = "10M"; |
|
|
|
|
|
|
|
String maxUploadSize = properties.getProperty(maxFileSizeKey, defaultSize); |
|
|
|
|
|
|
|
String maxBodySize = properties.getProperty(maxMemSizeKey, defaultSize); |
|
|
|
|
|
|
|
long size = Math.max(DataSize.parse(maxUploadSize).toBytes(), DataSize.parse(maxBodySize).toBytes()); |
|
|
|
|
|
|
|
properties.put(maxMemSizeKey, size); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|