solid-server 5.7.10 → 5.7.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common/js/index-buttons.js +2 -2
- package/lib/ldp.js +0 -9
- package/lib/models/account-manager.js +0 -2
- package/lib/utils.js +1 -1
- package/package.json +9 -2
|
@@ -30,7 +30,7 @@ document.addEventListener('DOMContentLoaded', async function() {
|
|
|
30
30
|
// HIDE LOGIN BUTTON, ADD REGISTER BUTTON
|
|
31
31
|
else {
|
|
32
32
|
let loginArea = document.getElementById('loginStatusArea');
|
|
33
|
-
let html = `<input type="button" onclick="window.location.href='/register'" value="Register to get a Pod" class="register-button">`
|
|
33
|
+
let html = `<input type="button" onclick="window.location.href='/register'" value="Register to get a Pod" class="register-button" style="padding: 1em; border-radius:0.2em; font-size: 100%;margin: 0.75em 0 0.75em 0.5em !important; padding: 0.5em !important;background-color: #efe;">`
|
|
34
34
|
let span = document.createElement("span")
|
|
35
35
|
span.innerHTML = html
|
|
36
36
|
loginArea.appendChild(span);
|
|
@@ -41,4 +41,4 @@ document.addEventListener('DOMContentLoaded', async function() {
|
|
|
41
41
|
signUpButton.style.display = "none";
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
})
|
|
44
|
+
})
|
package/lib/ldp.js
CHANGED
|
@@ -103,7 +103,6 @@ class LDP {
|
|
|
103
103
|
|
|
104
104
|
async listContainer (container, reqUri, containerData, hostname) {
|
|
105
105
|
const resourceGraph = $rdf.graph()
|
|
106
|
-
|
|
107
106
|
try {
|
|
108
107
|
$rdf.parse(containerData, resourceGraph, reqUri, 'text/turtle')
|
|
109
108
|
} catch (err) {
|
|
@@ -220,19 +219,16 @@ class LDP {
|
|
|
220
219
|
|
|
221
220
|
async put (url, stream, contentType) {
|
|
222
221
|
const container = (url.url || url).endsWith('/')
|
|
223
|
-
|
|
224
222
|
// PUT without content type is forbidden, unless PUTting container
|
|
225
223
|
if (!contentType && !container) {
|
|
226
224
|
throw error(400,
|
|
227
225
|
'PUT request requires a content-type via the Content-Type header')
|
|
228
226
|
}
|
|
229
|
-
|
|
230
227
|
// reject resource with percent-encoded $ extension
|
|
231
228
|
const dollarExtensionRegex = /%(?:24)\.[^%(?:24)]*$/ // /\$\.[^$]*$/
|
|
232
229
|
if ((url.url || url).match(dollarExtensionRegex)) {
|
|
233
230
|
throw error(400, 'Resource with a $.ext is not allowed by the server')
|
|
234
231
|
}
|
|
235
|
-
|
|
236
232
|
// First check if we are above quota
|
|
237
233
|
let isOverQuota
|
|
238
234
|
// Someone had a reason to make url actually a req sometimes but not
|
|
@@ -246,7 +242,6 @@ class LDP {
|
|
|
246
242
|
if (isOverQuota) {
|
|
247
243
|
throw error(413, 'User has exceeded their storage quota')
|
|
248
244
|
}
|
|
249
|
-
|
|
250
245
|
// Set url using folder/.meta. This is Hack to find folder path
|
|
251
246
|
if (container) {
|
|
252
247
|
if (typeof url !== 'string') {
|
|
@@ -256,22 +251,18 @@ class LDP {
|
|
|
256
251
|
}
|
|
257
252
|
contentType = 'text/turtle'
|
|
258
253
|
}
|
|
259
|
-
|
|
260
254
|
const { path } = await this.resourceMapper.mapUrlToFile({ url, contentType, createIfNotExists: true })
|
|
261
255
|
// debug.handlers(container + ' item ' + (url.url || url) + ' ' + contentType + ' ' + path)
|
|
262
256
|
// check if file exists, and in that case that it has the same extension
|
|
263
257
|
if (!container) { await this.checkFileExtension(url, path) }
|
|
264
|
-
|
|
265
258
|
// Create the enclosing directory, if necessary, do not create pubsub if PUT create container
|
|
266
259
|
await this.createDirectory(path, hostname, !container)
|
|
267
|
-
|
|
268
260
|
// clear cache
|
|
269
261
|
if (path.endsWith(this.suffixAcl)) {
|
|
270
262
|
const { url: aclUrl } = await this.resourceMapper.mapFileToUrl({ path, hostname })
|
|
271
263
|
clearAclCache(aclUrl)
|
|
272
264
|
// clearAclCache()
|
|
273
265
|
}
|
|
274
|
-
|
|
275
266
|
// Directory created, now write the file
|
|
276
267
|
if (container) return
|
|
277
268
|
return withLock(path, () => new Promise((resolve, reject) => {
|
|
@@ -89,12 +89,10 @@ class AccountManager {
|
|
|
89
89
|
try {
|
|
90
90
|
accountUri = this.accountUriFor(accountName)
|
|
91
91
|
accountUri = url.parse(accountUri).hostname
|
|
92
|
-
|
|
93
92
|
cardPath = url.resolve('/', this.pathCard)
|
|
94
93
|
} catch (err) {
|
|
95
94
|
return Promise.reject(err)
|
|
96
95
|
}
|
|
97
|
-
|
|
98
96
|
return this.accountUriExists(accountUri, cardPath)
|
|
99
97
|
}
|
|
100
98
|
|
package/lib/utils.js
CHANGED
|
@@ -201,7 +201,7 @@ async function getQuota (root, serverUri) {
|
|
|
201
201
|
return Infinity
|
|
202
202
|
}
|
|
203
203
|
const graph = $rdf.graph()
|
|
204
|
-
const storageUri = serverUri + '/'
|
|
204
|
+
const storageUri = serverUri.endsWith('/') ? serverUri : serverUri + '/'
|
|
205
205
|
try {
|
|
206
206
|
$rdf.parse(prefs, graph, storageUri, 'text/turtle')
|
|
207
207
|
} catch (error) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solid-server",
|
|
3
3
|
"description": "Solid server on top of the file-system",
|
|
4
|
-
"version": "5.7.
|
|
4
|
+
"version": "5.7.11",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Tim Berners-Lee",
|
|
7
7
|
"email": "timbl@w3.org"
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"ip-range-check": "0.2.0",
|
|
90
90
|
"is-ip": "^3.1.0",
|
|
91
91
|
"li": "^1.3.0",
|
|
92
|
-
"mashlib": "^1.8.
|
|
92
|
+
"mashlib": "^1.8.11",
|
|
93
93
|
"mime-types": "^2.1.35",
|
|
94
94
|
"negotiator": "^0.6.3",
|
|
95
95
|
"node-fetch": "^2.7.0",
|
|
@@ -147,6 +147,13 @@
|
|
|
147
147
|
"nyc": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 nyc --reporter=text-summary mocha --recursive test/integration/ test/unit/",
|
|
148
148
|
"mocha": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 mocha --recursive test/integration/ test/unit/",
|
|
149
149
|
"mocha-integration": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 mocha --recursive test/integration/http-test.js",
|
|
150
|
+
"mocha-account-creation-oidc": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 mocha --recursive test/integration/account-creation-oidc-test.js",
|
|
151
|
+
"mocha-account-manager": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 mocha --recursive test/integration/account-manager-test.js",
|
|
152
|
+
"mocha-account-template": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 mocha --recursive test/integration/account-template-test.js",
|
|
153
|
+
"mocha-acl-oidc": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 mocha --recursive test/integration/acl-oidc-test.js",
|
|
154
|
+
"mocha-authentication-oidc": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 mocha --recursive test/integration/authentication-oidc-test.js",
|
|
155
|
+
"mocha-header": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 mocha --recursive test/integration/header-test.js",
|
|
156
|
+
"mocha-ldp": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 mocha --recursive test/integration/ldp-test.js",
|
|
150
157
|
"prepublishOnly": "npm test",
|
|
151
158
|
"postpublish": "git push --follow-tags",
|
|
152
159
|
"test": "npm run standard && npm run validate && npm run nyc",
|