Skip to content

Commit

Permalink
Merge ba9af62 into cfc5405
Browse files Browse the repository at this point in the history
  • Loading branch information
adinauer authored Sep 30, 2024
2 parents cfc5405 + ba9af62 commit 24c454d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
6 changes: 6 additions & 0 deletions sentry-spring-boot-jakarta/api/sentry-spring-boot-jakarta.api
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ public class io/sentry/spring/boot/jakarta/SentryLogbackAppenderAutoConfiguratio
public fun sentryLogbackInitializer (Lio/sentry/spring/boot/jakarta/SentryProperties;)Lio/sentry/spring/boot/jakarta/SentryLogbackInitializer;
}

public class io/sentry/spring/boot/jakarta/SentryLogbackInitializer : org/springframework/context/event/GenericApplicationListener {
public fun <init> (Lio/sentry/spring/boot/jakarta/SentryProperties;)V
public fun onApplicationEvent (Lorg/springframework/context/ApplicationEvent;)V
public fun supportsEventType (Lorg/springframework/core/ResolvableType;)Z
}

public class io/sentry/spring/boot/jakarta/SentryProperties : io/sentry/SentryOptions {
public fun <init> ()V
public fun getExceptionResolverOrder ()I
Expand Down
6 changes: 6 additions & 0 deletions sentry-spring-boot/api/sentry-spring-boot.api
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ public class io/sentry/spring/boot/SentryLogbackAppenderAutoConfiguration {
public fun sentryLogbackInitializer (Lio/sentry/spring/boot/SentryProperties;)Lio/sentry/spring/boot/SentryLogbackInitializer;
}

public class io/sentry/spring/boot/SentryLogbackInitializer : org/springframework/context/event/GenericApplicationListener {
public fun <init> (Lio/sentry/spring/boot/SentryProperties;)V
public fun onApplicationEvent (Lorg/springframework/context/ApplicationEvent;)V
public fun supportsEventType (Lorg/springframework/core/ResolvableType;)Z
}

public class io/sentry/spring/boot/SentryProperties : io/sentry/SentryOptions {
public fun <init> ()V
public fun getExceptionResolverOrder ()I
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,17 @@ private boolean qualifiesForCaching(
return maxRequestBodySize != RequestSize.NONE
&& contentLength != -1
&& contentType != null
&& MimeType.valueOf(contentType).isCompatibleWith(MediaType.APPLICATION_JSON)
&& shouldCacheMimeType(contentType)
&& ((maxRequestBodySize == SMALL && contentLength < 1000)
|| (maxRequestBodySize == MEDIUM && contentLength < 10000)
|| maxRequestBodySize == ALWAYS);
}

private static boolean shouldCacheMimeType(String contentType) {
return MimeType.valueOf(contentType).isCompatibleWith(MediaType.APPLICATION_JSON)
|| MimeType.valueOf(contentType).isCompatibleWith(MediaType.APPLICATION_FORM_URLENCODED);
}

static final class RequestBodyExtractingEventProcessor implements EventProcessor {
private final @NotNull RequestPayloadExtractor requestPayloadExtractor =
new RequestPayloadExtractor();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,17 @@ private boolean qualifiesForCaching(
return maxRequestBodySize != RequestSize.NONE
&& contentLength != -1
&& contentType != null
&& MimeType.valueOf(contentType).isCompatibleWith(MediaType.APPLICATION_JSON)
&& shouldCacheMimeType(contentType)
&& ((maxRequestBodySize == SMALL && contentLength < 1000)
|| (maxRequestBodySize == MEDIUM && contentLength < 10000)
|| maxRequestBodySize == ALWAYS);
}

private static boolean shouldCacheMimeType(String contentType) {
return MimeType.valueOf(contentType).isCompatibleWith(MediaType.APPLICATION_JSON)
|| MimeType.valueOf(contentType).isCompatibleWith(MediaType.APPLICATION_FORM_URLENCODED);
}

static final class RequestBodyExtractingEventProcessor implements EventProcessor {
private final @NotNull RequestPayloadExtractor requestPayloadExtractor =
new RequestPayloadExtractor();
Expand Down

0 comments on commit 24c454d

Please sign in to comment.