Skip to content

Commit ce20b6a

Browse files
author
deiu
committed
Serve index.html instead of redirect to warp
1 parent 5486a19 commit ce20b6a

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

lib/handlers/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ function handler (req, res, next) {
2626
if (requestedType.indexOf('text/html') !== 0) {
2727
return next()
2828
}
29-
debug('Looking for index in ' + res.locals.path)
29+
debug('Looking for index in ' + req.path)
3030

31-
// Check if file exists in first place
32-
ldp.exists(req.hostname, res.locals.path, function (err) {
31+
// Check if file exists in first place
32+
ldp.exists(req.hostname, path.join(req.path, indexFile), function (err) {
3333
if (err) {
3434
return next()
3535
}

test/http.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ describe('HTTP APIs', function () {
232232
.expect(200, done)
233233
})
234234
it('should redirect to file browser if container was requested as text/html', function (done) {
235-
server.get('/sampleContainer/')
235+
server.get('/')
236236
.set('Accept', 'text/html')
237237
.expect('content-type', /text\/html/)
238238
.expect(303, done)
@@ -286,7 +286,7 @@ describe('HTTP APIs', function () {
286286
function (done) {
287287
server.get('/sampleContainer/')
288288
.set('accept', 'text/html')
289-
.expect(303)
289+
.expect(200)
290290
.expect('content-type', /text\/html/)
291291
.end(done)
292292
})

0 commit comments

Comments
 (0)