Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
/data
/coverage
/node_modules
/npm-debug.log
/npm-debug.log
8 changes: 8 additions & 0 deletions lib/ldp.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { join, dirname } = require('path')
const intoStream = require('into-stream')
const url = require('url')
const fs = require('fs')
const $rdf = require('rdflib')
Expand Down Expand Up @@ -160,6 +161,13 @@ class LDP {
}
const { url: putUrl, contentType } = await this.resourceMapper.mapFileToUrl(
{ path: this.resourceMapper.rootPath + resourcePath, hostname: host })

// HACK: the middleware in webid-oidc.js uses body-parser, thus ending the stream of data
// for JSON bodies. So, the stream needs to be reset
if (contentType.includes('application/json')) {
stream = intoStream(JSON.stringify(stream.body))
}

await ldp.put(putUrl, stream, contentType)
return originalPath
}
Expand Down
20 changes: 17 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
"homepage": "https://github.com/solid/node-solid-server",
"bugs": "https://github.com/solid/node-solid-server/issues",
"dependencies": {
"@solid/oidc-auth-manager": "^0.17.1",
"@solid/acl-check": "^0.2.0",
"@solid/oidc-auth-manager": "^0.17.1",
"body-parser": "^1.18.3",
"bootstrap": "^3.3.7",
"busboy": "^0.2.12",
Expand All @@ -79,6 +79,7 @@
"handlebars": "^4.0.13",
"http-proxy-middleware": "^0.18.0",
"inquirer": "^1.0.2",
"into-stream": "^5.0.0",
"ip-range-check": "0.0.2",
"is-ip": "^2.0.0",
"li": "^1.0.1",
Expand Down