fix: remove subpath support for HD_BASE_URL

With this commit we drop the subpath support which results in the constraint that HedgeDoc must always run on the root of a domain. This makes a lot of things in testing, rendering and security much easier.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2023-08-12 20:07:38 +02:00
parent 7401791ec8
commit dccd58f0c1
32 changed files with 111 additions and 116 deletions

View file

@ -54,7 +54,7 @@ const handler = (req: NextApiRequest, res: NextApiResponse) => {
],
branding: {
name: 'DEMO Corp',
logo: 'public/img/demo.png'
logo: '/public/img/demo.png'
},
useImageProxy: false,
specialUrls: {

View file

@ -10,7 +10,7 @@ import type { NextApiRequest, NextApiResponse } from 'next'
const handler = (req: NextApiRequest, res: NextApiResponse): void => {
respondToMatchingRequest<LoginUserInfo>(HttpMethod.GET, req, res, {
username: 'mock',
photo: 'public/img/avatar.png',
photo: '/public/img/avatar.png',
displayName: 'Mock User',
authProvider: 'local',
email: 'mock@hedgedoc.test'

View file

@ -20,7 +20,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse): Promise<void>
req,
res,
{
url: 'public/img/avatar.png',
url: '/public/img/avatar.png',
noteId: null,
username: 'test',
createdAt: '2022-02-27T21:54:23.856Z'

File diff suppressed because one or more lines are too long

View file

@ -11,7 +11,7 @@ const handler = (req: NextApiRequest, res: NextApiResponse): void => {
respondToMatchingRequest<UserInfo>(HttpMethod.GET, req, res, {
username: 'erik',
displayName: 'Erik',
photo: 'public/img/avatar.png'
photo: '/public/img/avatar.png'
})
}

View file

@ -11,7 +11,7 @@ const handler = (req: NextApiRequest, res: NextApiResponse): void => {
respondToMatchingRequest<UserInfo>(HttpMethod.GET, req, res, {
username: 'molly',
displayName: 'Molly',
photo: 'public/img/avatar.png'
photo: '/public/img/avatar.png'
})
}

View file

@ -11,7 +11,7 @@ const handler = (req: NextApiRequest, res: NextApiResponse): void => {
respondToMatchingRequest<UserInfo>(HttpMethod.GET, req, res, {
username: 'tilman',
displayName: 'Tilman',
photo: 'public/img/avatar.png'
photo: '/public/img/avatar.png'
})
}