File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
backend/main-service/src/main/java/io/blog/devlog/domain/post/service Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 1212import org .springframework .transaction .annotation .Transactional ;
1313
1414import java .sql .Timestamp ;
15+ import java .util .logging .Logger ;
1516
1617@ Service
1718@ RequiredArgsConstructor
@@ -26,7 +27,9 @@ public class PostViewsServiceImpl implements PostViewsService {
2627 public boolean increaseViewCount (Long postId , HttpServletRequest request ) {
2728 String clientIP = request .getRemoteAddr ();
2829 if (request .getHeader ("X-Forwarded-For" ) != null ) {
29- clientIP = request .getHeader ("X-Forwarded-For" ).split ("," )[0 ];
30+ String forwardForIp = request .getHeader ("X-Forwarded-For" );
31+ log .info ("X-Forwarded-For : " + forwardForIp );
32+ clientIP = forwardForIp .split ("," )[0 ];
3033 }
3134 String hashIP = DigestUtils .md5Hex (clientIP );
3235
You can’t perform that action at this time.
0 commit comments