mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
fix: Trust X-Forwarded headers in the IDP
This commit is contained in:
parent
41694a171d
commit
2df3f1f28c
@ -101,7 +101,10 @@ export class IdentityProviderFactory implements ProviderFactory {
|
|||||||
// Render errors with our own error handler
|
// Render errors with our own error handler
|
||||||
this.configureErrors(config);
|
this.configureErrors(config);
|
||||||
|
|
||||||
return new Provider(this.baseUrl, config);
|
// Allow provider to interpret reverse proxy headers
|
||||||
|
const provider = new Provider(this.baseUrl, config);
|
||||||
|
provider.proxy = true;
|
||||||
|
return provider;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -79,7 +79,9 @@ describe('An IdentityProviderFactory', (): void => {
|
|||||||
|
|
||||||
it('creates a correct configuration.', async(): Promise<void> => {
|
it('creates a correct configuration.', async(): Promise<void> => {
|
||||||
// This is the output of our mock function
|
// This is the output of our mock function
|
||||||
const { issuer, config } = await factory.getProvider() as unknown as { issuer: string; config: Configuration };
|
const provider = await factory.getProvider() as any;
|
||||||
|
expect(provider.proxy).toBe(true);
|
||||||
|
const { issuer, config } = provider as { issuer: string; config: Configuration };
|
||||||
expect(issuer).toBe(baseUrl);
|
expect(issuer).toBe(baseUrl);
|
||||||
|
|
||||||
// Copies the base config
|
// Copies the base config
|
||||||
|
Loading…
x
Reference in New Issue
Block a user