Skip to content
Snippets Groups Projects
Commit ded6af8a authored by richard.petersen's avatar richard.petersen :sailboat:
Browse files

Fix: OXUIB-1378 - 7.10.x share links don't work with 8.0 (2)

Use redirect instead of delivering index.html to prevent /ui paths in the future
parent bd136fa2
No related branches found
No related tags found
No related merge requests found
......@@ -76,13 +76,6 @@ describe('File caching service', function () {
expect(response.text).to.equal('<html><head></head><body>it\'s me</body></html>')
})
it('serves /ui as index.html', async function () {
const response = await request(app).get('/ui')
expect(response.statusCode).to.equal(200)
expect(response.headers['content-type']).to.equal('text/html')
expect(response.text).to.equal('<html><head></head><body>it\'s me</body></html>')
})
it('adds / to dependencies', async function () {
const response = await request(app).get('/dependencies')
expect(response.statusCode).to.equal(200)
......
......@@ -32,4 +32,10 @@ describe('Redirects', function () {
expect(response.statusCode).to.equal(302)
expect(response.headers.location).to.equal('/appsuite/whatever/path')
})
it('redirects /ui to /', async function () {
const response = await request(app).get('/ui')
expect(response.statusCode).to.equal(302)
expect(response.headers.location).to.equal('/')
})
})
......@@ -115,9 +115,7 @@ export function createApp () {
// this should hopefully be resolved with an ingress
// or proper config. But is used to be safe on all ends
app.get('/ui', async (req, res, next) => {
const { 'content-type': contentType, content } = fileCache.get('/index.html')
if (content) return res.setHeader('content-type', contentType).status(200).send(content)
next()
res.redirect(process.env.APP_ROOT)
})
app.post('/redirect', (req, res, next) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment