Skip to content

Commit

Permalink
refactor: remove IP address judgment for device management (#6275)
Browse files Browse the repository at this point in the history
#### What type of PR is this?
/kind bug
/area core
/milestone 2.18.x

#### What this PR does / why we need it:
设备管理去除 IP 地址检查以避免频繁登录

#### Does this PR introduce a user-facing change?
```release-note
设备管理去除 IP 地址检查以避免频繁登录
```
  • Loading branch information
guqing authored Jul 5, 2024
1 parent 708b8be commit 36bc461
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,7 @@ private Mono<Device> updateExistingDevice(ServerWebExchange exchange) {
var userAgent =
exchange.getRequest().getHeaders().getFirst(HttpHeaders.USER_AGENT);
var deviceUa = existingDevice.getSpec().getUserAgent();
var ipAddr = existingDevice.getSpec().getIpAddress();
var clientIp = getClientIp(exchange.getRequest());
if (!StringUtils.equals(deviceUa, userAgent)
|| !StringUtils.equals(clientIp, ipAddr)) {
if (!StringUtils.equals(deviceUa, userAgent)) {
// User agent changed, create a new device
return Mono.empty();
}
Expand Down

0 comments on commit 36bc461

Please sign in to comment.