Skip to content
Snippets Groups Projects
Commit bd136fa2 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

Root cause: There are middlewares, which still use old redirects to /ui
Solution: To prevent 404s, we just serve the index.html
parent c5b861be
No related branches found
No related tags found
No related merge requests found
......@@ -76,6 +76,13 @@ 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)
......
......@@ -111,6 +111,15 @@ export function createApp () {
next()
})
// backwards compatibility for 7.10.x
// 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()
})
app.post('/redirect', (req, res, next) => {
const location = req.body.location || '../busy.html'
res.redirect(location)
......
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