From 1b601896b038d15dcddad5abc7d033bd074a14b4 Mon Sep 17 00:00:00 2001 From: Pedro Sanders Date: Fri, 19 Jan 2024 20:18:01 -0400 Subject: [PATCH] chore: set nonce count only if available --- .../src/main/java/io/routr/headers/AuthorizationConverter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mods/edgeport/src/main/java/io/routr/headers/AuthorizationConverter.java b/mods/edgeport/src/main/java/io/routr/headers/AuthorizationConverter.java index 20b23182e..3eecacce0 100644 --- a/mods/edgeport/src/main/java/io/routr/headers/AuthorizationConverter.java +++ b/mods/edgeport/src/main/java/io/routr/headers/AuthorizationConverter.java @@ -56,10 +56,11 @@ public Authorization fromDTO(io.routr.message.Authorization dto) HeaderFactory factory = SipFactory.getInstance().createHeaderFactory(); AddressFactory addrFactory = SipFactory.getInstance().createAddressFactory(); Authorization header = (Authorization) factory.createAuthorizationHeader(dto.getScheme()); - header.setNonceCount(dto.getNonceCount()); + header.setRealm(dto.getRealm()); header.setOpaque(dto.getOpaque()); + if (dto.getNonceCount() > -1) header.setNonceCount(dto.getNonceCount()); if (!dto.getNonce().isEmpty()) header.setNonce(dto.getNonce()); if (!dto.getCNonce().isEmpty()) header.setCNonce(dto.getCNonce()); if (!dto.getAlgorithm().isEmpty()) header.setAlgorithm(dto.getAlgorithm());