From 1ab5d9182c6e354a7d946ffce0173ff9da84f74f Mon Sep 17 00:00:00 2001 From: jcw1031 Date: Wed, 21 Feb 2024 20:04:38 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20googlebot=20=EB=93=B1=EB=A1=9D=20X?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/ac/knu/likeknu/service/DeviceService.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/ac/knu/likeknu/service/DeviceService.java b/src/main/java/ac/knu/likeknu/service/DeviceService.java index e4cea2d..ee6a1c0 100644 --- a/src/main/java/ac/knu/likeknu/service/DeviceService.java +++ b/src/main/java/ac/knu/likeknu/service/DeviceService.java @@ -33,11 +33,16 @@ public DeviceService(DeviceRepository deviceRepository) { } public void registerDeviceId(DeviceRegistrationRequest deviceRequest) { + String userAgent = deviceRequest.userAgent(); + if (userAgent.contains("Googlebot")) { + return; + } + String deviceId = deviceRequest.deviceId(); Device device = deviceRepository.findById(deviceId) .orElseGet(() -> Device.of(deviceRequest)); - device.updatePlatform(deviceRequest.userAgent()); + device.updatePlatform(userAgent); String campus = deviceRequest.campus(); device.updateCampus(Campus.of(campus)); device.visitNow();