Skip to content

Commit 9e6e2a4

Browse files
Use data browser for containers as well. (#573)
Closes #537.
1 parent 256beeb commit 9e6e2a4

File tree

7 files changed

+7
-42
lines changed

7 files changed

+7
-42
lines changed

README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ $ solid start --help
159159
--ssl-cert [value] Path to the SSL certificate key in PEM format
160160
--multiuser Enable multi-user mode
161161
--corsProxy [value] Serve the CORS proxy on this path
162-
--file-browser [value] Url to file browser app (uses Warp by default)
163162
--data-browser Enable viewing RDF resources using a default data browser application (e.g. mashlib)
164163
--suffix-acl [value] Suffix for acl files (default: '.acl')
165164
--suffix-meta [value] Suffix for metadata files (default: '.meta')
@@ -293,13 +292,7 @@ accidentally commit your certificates to `solid` while you're developing.
293292
If you started your `solid` server locally on port 8443 as in the example
294293
above, you would then be able to visit `https://localhost:8443` in the browser
295294
(ignoring the Untrusted Connection browser warnings as usual), where your
296-
`solid` server would redirect you to the default viewer app (see the
297-
`--file-browser` server config parameter), which is usually the
298-
[github.io/warp](https://linkeddata.github.io/warp/#/list/) file browser.
299-
300-
Accessing most Solid apps (such as Warp) will prompt you to select your browser
301-
side certificate which contains a WebID from a Solid storage provider (see
302-
the [pre-requisites](#pre-requisites) discussion above).
295+
`solid` server would redirect you to the default data viewer app.
303296

304297
#### Editing your local `/etc/hosts`
305298

bin/lib/options.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -173,19 +173,6 @@ module.exports = [
173173
prompt: false,
174174
hide: true
175175
},
176-
{
177-
name: 'file-browser',
178-
help: 'Type the URL of default app to use for browsing files (or use default)',
179-
default: 'default',
180-
filter: function (value) {
181-
if (value === 'default' || value === 'warp') {
182-
return 'https://linkeddata.github.io/warp/#/list/'
183-
}
184-
return value
185-
},
186-
prompt: false
187-
},
188-
189176
{
190177
name: 'suppress-data-browser',
191178
help: 'Suppress provision of a data browser',
@@ -194,7 +181,6 @@ module.exports = [
194181
default: false,
195182
hide: false
196183
},
197-
198184
{
199185
name: 'data-browser-path',
200186
help: 'An HTML file which is sent to allow users to browse the data (eg using mashlib.js)',

lib/handlers/get.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,13 @@ function handler (req, res, next) {
7575
return next()
7676
}
7777

78-
// Handle fileBrowser and dataBrowser
78+
// Handle dataBrowser
7979
if (requestedType && requestedType.includes('text/html')) {
80-
if (container && ldp.fileBrowser) {
81-
var address = req.protocol + '/' + req.get('host') + req.originalUrl
82-
return res.redirect(303, ldp.fileBrowser + address)
83-
}
84-
8580
let mimeTypeByExt = mime.lookup(_path.basename(path))
8681
let isHtmlResource = mimeTypeByExt && mimeTypeByExt.includes('html')
87-
let useDataBrowser = RDFs.includes(contentType) &&
88-
!isHtmlResource && // filter out .html which IS an RDF type, but does not use data browser
89-
!ldp.suppressDataBrowser &&
90-
ldp.dataBrowserPath
82+
let useDataBrowser = ldp.dataBrowserPath && (
83+
container ||
84+
RDFs.includes(contentType) && !isHtmlResource && !ldp.suppressDataBrowser)
9185

9286
if (useDataBrowser) {
9387
res.set('Content-Type', 'text/html')

lib/ldp.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,6 @@ class LDP {
6464
}
6565
}
6666

67-
if (this.fileBrowser !== false) {
68-
this.fileBrowser = argv.fileBrowser ||
69-
'https://linkeddata.github.io/warp/#/list/'
70-
}
71-
7267
if (this.skin !== false) {
7368
this.skin = true
7469
}
@@ -87,7 +82,6 @@ class LDP {
8782
debug.settings('Allow WebID authentication: ' + !!this.webid)
8883
debug.settings('Live-updates: ' + !!this.live)
8984
debug.settings('Multi-user: ' + !!this.multiuser)
90-
debug.settings('Default file browser app: ' + this.fileBrowser)
9185
debug.settings('Suppress default data browser app: ' + this.suppressDataBrowser)
9286
debug.settings('Default data browser app file path: ' + this.dataBrowserPath)
9387

test/integration/authentication-oidc-test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ describe('Authentication API (OIDC)', () => {
4242
sslCert: path.join(__dirname, '../keys/cert.pem'),
4343
auth: 'oidc',
4444
dataBrowser: false,
45-
fileBrowser: false,
4645
webid: true,
4746
multiuser: false,
4847
configPath

test/integration/capability-discovery-test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ describe('API', () => {
1919
sslCert: path.join(__dirname, '../keys/cert.pem'),
2020
auth: 'oidc',
2121
dataBrowser: false,
22-
fileBrowser: false,
2322
webid: true,
2423
multiuser: false,
2524
configPath

test/integration/http-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,11 @@ describe('HTTP APIs', function () {
276276
.end(done)
277277
})
278278

279-
it('should redirect to file browser if container was requested as text/html', function (done) {
279+
it('should show data browser if container was requested as text/html', function (done) {
280280
server.get('/sampleContainer2/')
281281
.set('Accept', 'text/html')
282282
.expect('content-type', /text\/html/)
283-
.expect(303, done)
283+
.expect(200, done)
284284
})
285285
it('should redirect to the right container URI if missing /', function (done) {
286286
server.get('/sampleContainer')

0 commit comments

Comments
 (0)