Skip to content

Commit 1e50f5a

Browse files
fix: empty resourceURI in put body (#552)
1 parent 1ed8a99 commit 1e50f5a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

internal/message/wsman.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,12 @@ func (w WSManMessageCreator) CreateBody(method, wsmanClass string, data interfac
9595
log.Println(err)
9696
}
9797

98-
str.WriteString(string(xmlString))
98+
xmlStr := string(xmlString)
99+
100+
namespace := fmt.Sprintf("%s%s", w.ResourceURIBase, wsmanClass)
101+
xmlStr = strings.ReplaceAll(xmlStr, `xmlns:h=""`, fmt.Sprintf(`xmlns:h="%s"`, namespace))
102+
103+
str.WriteString(xmlStr)
99104
} else {
100105
str.WriteString(fmt.Sprintf(`<h:%s xmlns:h="%s%s">`, method, w.ResourceURIBase, wsmanClass))
101106
str.WriteString(fmt.Sprintf(`</h:%s>`, method))

0 commit comments

Comments
 (0)