Skip to content

Commit 14f9f3d

Browse files
authored
Merge pull request #35 from SolidOS/rdfxml
default content for rdf+xml
2 parents 831ee33 + 9e3567e commit 14f9f3d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

sourcePane.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,17 @@ module.exports = {
5151
throw new Error(msg)
5252
}
5353

54+
function contentForNew (contentType) {
55+
let content = '\n'
56+
if (contentType.includes('json')) content = '{}\n'
57+
else if (contentType.includes('rdf+xml')) content = '<rdf:RDF\n xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">\n\n</rdf:RDF>'
58+
return content
59+
}
60+
5461
return new Promise(function (resolve, reject) {
5562
kb.fetcher
5663
.webOperation('PUT', newInstance.uri, {
57-
data: contentType.includes('json') ? '{}\n' : '\n',
64+
data: contentForNew(contentType),
5865
contentType: contentType
5966
})
6067
.then(

0 commit comments

Comments
 (0)