This commit is contained in:
@@ -88,7 +88,7 @@ describe('dashboard middleware', () => {
|
||||
expect(response).toEqual({ kind: 'redirect', url: 'https://rentaldrivego.example/dashboard/sign-in?redirect=%2Fdashboard%2Freservations' })
|
||||
})
|
||||
|
||||
it('uses trusted forwarded host/proto when building the dashboard sign-in redirect', async () => {
|
||||
it('ignores spoofed forwarded host/proto when building the dashboard sign-in redirect', async () => {
|
||||
const { default: middleware } = await loadMiddleware('https://market.example.com')
|
||||
|
||||
const response = middleware(request('http://dashboard:3001/dashboard/billing', {
|
||||
@@ -98,7 +98,7 @@ describe('dashboard middleware', () => {
|
||||
},
|
||||
}) as never)
|
||||
|
||||
expect(response).toEqual({ kind: 'redirect', url: 'https://workspace.customer.example/dashboard/sign-in?redirect=%2Fdashboard%2Fbilling' })
|
||||
expect(response).toEqual({ kind: 'redirect', url: 'https://market.example.com/dashboard/sign-in?redirect=%2Fdashboard%2Fbilling' })
|
||||
})
|
||||
|
||||
it('ignores internal forwarded hosts when building the dashboard sign-in redirect', async () => {
|
||||
@@ -119,7 +119,7 @@ describe('dashboard middleware', () => {
|
||||
|
||||
const response = middleware(request('https://workspace.example.com/dashboard/sign-in?redirect=/dashboard/fleet', { token: 'employee-token' }) as never)
|
||||
|
||||
expect(response).toEqual({ kind: 'redirect', url: 'https://workspace.example.com/dashboard' })
|
||||
expect(response).toEqual({ kind: 'redirect', url: 'https://market.example.com/dashboard' })
|
||||
})
|
||||
|
||||
it('allows public dashboard auth pages without a token', async () => {
|
||||
|
||||
Reference in New Issue
Block a user