Skip to content

Commit 13bb97a

Browse files
committed
remove unnecessary config options
1 parent 0d7a751 commit 13bb97a

2 files changed

Lines changed: 7 additions & 41 deletions

File tree

src/app-engine.d.ts

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
11
import type { Context } from '@netlify/edge-functions'
22

3-
export declare function getAllowedHosts(config?: {
4-
additionalAllowedHosts?: string[]
5-
injectDefaults?: boolean
6-
}): string[]
7-
3+
export declare function getAllowedHosts(): string[]
84
export declare function getContext(): Context | undefined
9-
10-
export declare function getTrustProxyHeaders(
11-
config?:
12-
| {
13-
additionalTrustProxyHeaders?: string[]
14-
}
15-
| {
16-
trustAll?: boolean
17-
},
18-
): boolean | string[]
5+
export declare function getTrustProxyHeaders(): string[]

src/app-engine.js

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,9 @@ import { env } from 'node:process'
22

33
/**
44
* Generate `allowedHosts` config for `AngularAppEngine` from `@angular/ssr`
5-
* @param {Object} [config={}]
6-
* @param {string[]} [config.additionalAllowedHosts=[]] Additional allowed hosts
7-
* @param {boolean} [config.injectDefaults=true] Whether to inject Netlify default hosts
8-
*
95
* @returns {string[]}
106
*/
11-
export function getAllowedHosts({ additionalAllowedHosts = [], injectDefaults = true } = {}) {
12-
if (!injectDefaults || additionalAllowedHosts.includes('*')) {
13-
return [...new Set(additionalAllowedHosts)]
14-
}
15-
7+
export function getAllowedHosts() {
168
const defaultAllowedHosts = []
179

1810
let deployId
@@ -87,12 +79,11 @@ export function getAllowedHosts({ additionalAllowedHosts = [], injectDefaults =
8779
defaultAllowedHosts.push(`${deployId}--${siteId}.netlify.app`)
8880
}
8981

90-
return [...new Set([...defaultAllowedHosts, ...additionalAllowedHosts])]
82+
return [...new Set(defaultAllowedHosts)]
9183
}
9284

9385
/**
9486
* Return Netlify-specific context
95-
*
9687
* @returns {import('@netlify/edge-functions').Context | undefined}
9788
*/
9889
export function getContext() {
@@ -144,20 +135,8 @@ function getHostnameFromEnvironmentVariable(environmentVariable) {
144135

145136
/**
146137
* Generate `trustProxyHeaders` config for `AngularAppEngine` from `@angular/ssr`
147-
*
148-
* @param {{
149-
* additionalTrustProxyHeaders?: string[]
150-
* } | {
151-
* trustAll?: boolean
152-
* }} [config]
153-
*
154-
* @returns {boolean | string[]}
138+
* @returns {string[]}
155139
*/
156-
157-
export function getTrustProxyHeaders({ additionalTrustProxyHeaders = [], trustAll = false } = {}) {
158-
if (trustAll === true) {
159-
return true
160-
}
161-
162-
return [...new Set(['x-forwarded-for', ...additionalTrustProxyHeaders])]
140+
export function getTrustProxyHeaders() {
141+
return ['x-forwarded-for']
163142
}

0 commit comments

Comments
 (0)