Skip to content

Commit 4492f7c

Browse files
committed
resolve isssue #520
1 parent 01dd0f9 commit 4492f7c

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

src/signed-xml.ts

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,27 +1135,7 @@ export class SignedXml {
11351135
if (ref.isEmptyUri) {
11361136
targetUri = "";
11371137
} else {
1138-
let id: string | null = null;
1139-
if (this.idMode === "wssecurity") {
1140-
const attr = utils.findAttr(
1141-
node,
1142-
"Id",
1143-
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd",
1144-
);
1145-
if (attr) {
1146-
id = attr.value;
1147-
}
1148-
} else {
1149-
for (const attr of this.idAttributes) {
1150-
id = node.getAttribute(attr);
1151-
if (id) {
1152-
break;
1153-
}
1154-
}
1155-
}
1156-
if (!id) {
1157-
throw new Error(`No ID attribute found on node for reference: ${ref.xpath}`);
1158-
}
1138+
const id = this.ensureHasId(node);
11591139
ref.uri = id;
11601140
targetUri = `#${id}`;
11611141
}

0 commit comments

Comments
 (0)