File tree Expand file tree Collapse file tree 4 files changed +24
-2
lines changed
sentry-spring-boot-jakarta/api
sentry-spring-jakarta/src/main/java/io/sentry/spring/jakarta
sentry-spring/src/main/java/io/sentry/spring Expand file tree Collapse file tree 4 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,12 @@ public class io/sentry/spring/boot/jakarta/SentryLogbackAppenderAutoConfiguratio
18
18
public fun sentryLogbackInitializer (Lio/sentry/spring/boot/jakarta/SentryProperties;)Lio/sentry/spring/boot/jakarta/SentryLogbackInitializer;
19
19
}
20
20
21
+ public class io/sentry/spring/boot/jakarta/SentryLogbackInitializer : org/springframework/context/event/GenericApplicationListener {
22
+ public fun <init> (Lio/sentry/spring/boot/jakarta/SentryProperties;)V
23
+ public fun onApplicationEvent (Lorg/springframework/context/ApplicationEvent;)V
24
+ public fun supportsEventType (Lorg/springframework/core/ResolvableType;)Z
25
+ }
26
+
21
27
public class io/sentry/spring/boot/jakarta/SentryProperties : io/sentry/SentryOptions {
22
28
public fun <init> ()V
23
29
public fun getExceptionResolverOrder ()I
Original file line number Diff line number Diff line change @@ -18,6 +18,12 @@ public class io/sentry/spring/boot/SentryLogbackAppenderAutoConfiguration {
18
18
public fun sentryLogbackInitializer (Lio/sentry/spring/boot/SentryProperties;)Lio/sentry/spring/boot/SentryLogbackInitializer;
19
19
}
20
20
21
+ public class io/sentry/spring/boot/SentryLogbackInitializer : org/springframework/context/event/GenericApplicationListener {
22
+ public fun <init> (Lio/sentry/spring/boot/SentryProperties;)V
23
+ public fun onApplicationEvent (Lorg/springframework/context/ApplicationEvent;)V
24
+ public fun supportsEventType (Lorg/springframework/core/ResolvableType;)Z
25
+ }
26
+
21
27
public class io/sentry/spring/boot/SentryProperties : io/sentry/SentryOptions {
22
28
public fun <init> ()V
23
29
public fun getExceptionResolverOrder ()I
Original file line number Diff line number Diff line change @@ -134,12 +134,17 @@ private boolean qualifiesForCaching(
134
134
return maxRequestBodySize != RequestSize .NONE
135
135
&& contentLength != -1
136
136
&& contentType != null
137
- && MimeType . valueOf (contentType ). isCompatibleWith ( MediaType . APPLICATION_JSON )
137
+ && shouldCacheMimeType (contentType )
138
138
&& ((maxRequestBodySize == SMALL && contentLength < 1000 )
139
139
|| (maxRequestBodySize == MEDIUM && contentLength < 10000 )
140
140
|| maxRequestBodySize == ALWAYS );
141
141
}
142
142
143
+ private static boolean shouldCacheMimeType (String contentType ) {
144
+ return MimeType .valueOf (contentType ).isCompatibleWith (MediaType .APPLICATION_JSON )
145
+ || MimeType .valueOf (contentType ).isCompatibleWith (MediaType .APPLICATION_FORM_URLENCODED );
146
+ }
147
+
143
148
static final class RequestBodyExtractingEventProcessor implements EventProcessor {
144
149
private final @ NotNull RequestPayloadExtractor requestPayloadExtractor =
145
150
new RequestPayloadExtractor ();
Original file line number Diff line number Diff line change @@ -134,12 +134,17 @@ private boolean qualifiesForCaching(
134
134
return maxRequestBodySize != RequestSize .NONE
135
135
&& contentLength != -1
136
136
&& contentType != null
137
- && MimeType . valueOf (contentType ). isCompatibleWith ( MediaType . APPLICATION_JSON )
137
+ && shouldCacheMimeType (contentType )
138
138
&& ((maxRequestBodySize == SMALL && contentLength < 1000 )
139
139
|| (maxRequestBodySize == MEDIUM && contentLength < 10000 )
140
140
|| maxRequestBodySize == ALWAYS );
141
141
}
142
142
143
+ private static boolean shouldCacheMimeType (String contentType ) {
144
+ return MimeType .valueOf (contentType ).isCompatibleWith (MediaType .APPLICATION_JSON )
145
+ || MimeType .valueOf (contentType ).isCompatibleWith (MediaType .APPLICATION_FORM_URLENCODED );
146
+ }
147
+
143
148
static final class RequestBodyExtractingEventProcessor implements EventProcessor {
144
149
private final @ NotNull RequestPayloadExtractor requestPayloadExtractor =
145
150
new RequestPayloadExtractor ();
You can’t perform that action at this time.
0 commit comments