File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
src/main/java/ru/mystamps/web/feature/site Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 17
17
*/
18
18
package ru .mystamps .web .feature .site ;
19
19
20
- import lombok .extern .slf4j .Slf4j ;
21
20
import org .apache .commons .lang3 .StringUtils ;
21
+ import org .slf4j .Logger ;
22
+ import org .slf4j .LoggerFactory ;
22
23
import org .springframework .http .HttpStatus ;
23
24
import org .springframework .web .bind .annotation .PostMapping ;
24
25
import org .springframework .web .bind .annotation .RequestBody ;
30
31
import java .util .regex .Pattern ;
31
32
32
33
@ RestController
33
- @ Slf4j
34
34
public class CspController {
35
+ private static final Logger LOG = LoggerFactory .getLogger (CspController .class );
36
+
35
37
private static final String UNKNOWN = "<unknown>" ;
36
38
37
39
private static final Pattern ORIGINAL_POLICY_PATTERN = Pattern .compile (
@@ -46,11 +48,11 @@ public void handleReport(
46
48
@ RequestHeader (name = "user-agent" , defaultValue = UNKNOWN ) String userAgent ) {
47
49
48
50
String ip = StringUtils .defaultString (request .getRemoteAddr (), UNKNOWN );
49
- log .warn ("CSP report from IP: {}, user agent: {}" , ip , userAgent );
51
+ LOG .warn ("CSP report from IP: {}, user agent: {}" , ip , userAgent );
50
52
51
53
// Omit "original-policy" as it quite long and useless most of the time
52
54
String report = ORIGINAL_POLICY_PATTERN .matcher (body ).replaceFirst (StringUtils .EMPTY );
53
- log .warn (report );
55
+ LOG .warn (report );
54
56
}
55
57
56
58
}
You can’t perform that action at this time.
0 commit comments