mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-13 14:44:43 -04:00
refactor(media): add media redirection endpoint
Previous versions of HedgeDoc suffered from the problem that changing the media backend required manipulation of the media links in all created notes. We discussed in #3704 that it's favourable to have an endpoint that redirects to the image's original URL. When changing the media backend, the link stays the same but just the redirect changes. Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
parent
1f19a6fac4
commit
8693edbf6a
16 changed files with 104 additions and 87 deletions
|
@ -1,10 +1,10 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2024 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
const imageUrl = 'http://example.com/non-existing.png'
|
||||
const imageId = 'non-existing.png'
|
||||
|
||||
describe('File upload', () => {
|
||||
beforeEach(() => {
|
||||
|
@ -22,7 +22,7 @@ describe('File upload', () => {
|
|||
{
|
||||
statusCode: 201,
|
||||
body: {
|
||||
url: imageUrl
|
||||
id: imageId
|
||||
}
|
||||
}
|
||||
)
|
||||
|
@ -38,7 +38,7 @@ describe('File upload', () => {
|
|||
},
|
||||
{ force: true }
|
||||
)
|
||||
cy.get('.cm-line').contains(``)
|
||||
cy.get('.cm-line').contains(``)
|
||||
})
|
||||
|
||||
it('via paste', () => {
|
||||
|
@ -51,7 +51,7 @@ describe('File upload', () => {
|
|||
}
|
||||
}
|
||||
cy.get('.cm-content').trigger('paste', pasteEvent)
|
||||
cy.get('.cm-line').contains(``)
|
||||
cy.get('.cm-line').contains(``)
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -65,7 +65,7 @@ describe('File upload', () => {
|
|||
},
|
||||
{ action: 'drag-drop', force: true }
|
||||
)
|
||||
cy.get('.cm-line').contains(``)
|
||||
cy.get('.cm-line').contains(``)
|
||||
})
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue