Skip to content

Commit

Permalink
SEBSP-169 Patch Issue 2.0.2: Prevent error and queue overflow when SE…
Browse files Browse the repository at this point in the history
…B sends to long metadata
  • Loading branch information
anhefti committed Oct 29, 2024
1 parent 1b4b650 commit e7a0ba8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import ch.ethz.seb.sps.utils.Constants;
import ch.ethz.seb.sps.utils.Utils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
Expand Down Expand Up @@ -284,9 +285,9 @@ public CompletableFuture<Void> postScreenshot(
() -> {
try {

// EBSP-169 Patch Issue 2.0.2: Prevent error and queue overflow when SEB sends to long metadata
// SEBSP-169 Patch Issue 2.0.2: Prevent error and queue overflow when SEB sends to long metadata
// TODO replace this with attempt to fix metadata instead of complete skip
if (metadata != null && metadata.length() > 3980) {
if (metadata != null && metadata.length() > Constants.MAX_METADATA_SIZE) {

log.warn("Sent metadata to long. Sent by SEB with session: {} metadata: {}", sessionUUID, metadata);

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/ch/ethz/seb/sps/utils/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public final class Constants {
public static final String DEFAULT_TIME_ZONE_CODE = "UTC";
public static final String TOOLTIP_TEXT_KEY_SUFFIX = ".tooltip";

// NOTE: DB Varchar is 4000 but we lave some sec gap here
public static final int MAX_METADATA_SIZE = 3980;
public static final int SEB_FILE_HEADER_SIZE = 4;
public static final int JN_CRYPTOR_ITERATIONS = 10000;
public static final int JN_CRYPTOR_VERSION_HEADER_SIZE = 1;
Expand Down

0 comments on commit e7a0ba8

Please sign in to comment.