Skip to content

Commit

Permalink
chore: set nonce count only if available
Browse files Browse the repository at this point in the history
  • Loading branch information
psanders committed Jan 20, 2024
1 parent d23c732 commit 1b60189
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 1b60189

Please sign in to comment.