Pull request #605: RED-6105 - Cannot import exported specific Dossier Template
Merge in RED/persistence-service from bugfix/RED-6105-1 to master * commit 'a45b841d5b6ef66821aa1b524ccdc7b9d33002d9': RED-6105 - Cannot import exported specific Dossier Template
This commit is contained in:
commit
7e965b2b2f
@ -2,7 +2,7 @@ package com.iqser.red.service.persistence.service.v1.api.model;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class IdentityTest {
|
||||
|
||||
|
||||
@ -28,11 +28,16 @@ public class SectionText {
|
||||
private boolean isTable;
|
||||
private String headline;
|
||||
|
||||
@Builder.Default
|
||||
private List<SectionArea> sectionAreas = new ArrayList<>();
|
||||
@Builder.Default
|
||||
private Set<Image> images = new HashSet<>();
|
||||
|
||||
@Builder.Default
|
||||
private List<TextBlock> textBlocks = new ArrayList<>();
|
||||
@Builder.Default
|
||||
private Map<String, CellValue> tabularData = new HashMap<>();
|
||||
@Builder.Default
|
||||
private List<Integer> cellStarts = new ArrayList<>();
|
||||
|
||||
}
|
||||
|
||||
@ -23,6 +23,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
public class TextPositionSequence {
|
||||
|
||||
private int page;
|
||||
@Builder.Default
|
||||
private List<RedTextPosition> textPositions = new ArrayList<>();
|
||||
|
||||
// Removed
|
||||
|
||||
@ -567,7 +567,7 @@ public class DossierTemplateImportService {
|
||||
totalSizeArchive += nBytes;
|
||||
|
||||
double compressionRatio = (float) totalSizeEntry / ze.getCompressedSize();
|
||||
if (compressionRatio > settings.getCompressionTresholdRatio()) {
|
||||
if (compressionRatio > settings.getCompressionThresholdRatio()) {
|
||||
log.debug("zip entry: " + ze.getName() + " - totalSizeEntry: " + totalSizeEntry + " ze.getCompressedSize(): " + ze.getCompressedSize() + " compressionRatio: " + compressionRatio);
|
||||
// ratio between compressed and uncompressed data is highly suspicious, looks like a Zip Bomb Attack
|
||||
throw new BadRequestException("ZIP-Bomb detected (compressionRatio).");
|
||||
|
||||
@ -38,6 +38,6 @@ public class FileManagementServiceSettings {
|
||||
|
||||
private boolean ocrByDefault;
|
||||
|
||||
private double compressionTresholdRatio = 10;
|
||||
private double compressionThresholdRatio = 10;
|
||||
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.iqser.red</groupId>
|
||||
<artifactId>platform-dependency</artifactId>
|
||||
<version>1.13.0</version>
|
||||
<version>1.16.0</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user