Skip to content

Commit 013fa87

Browse files
Vardhaman619ematipico
andauthoredMar 18, 2025··
fix(config): handle boolean server.allowedHosts (#13437)
Co-authored-by: ematipico <602478+ematipico@users.noreply.github.com>
1 parent bcf1923 commit 013fa87

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed
 

‎.changeset/bitter-rockets-pull.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'astro': minor
3+
---
4+
5+
Handle server.allowedHosts when the value is true without attempting to push it into an array.

‎packages/astro/src/core/config/merge.ts

+5
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ function mergeConfigRecursively(
4040
}
4141
}
4242

43+
// for server.allowedHosts, if the value is a boolean
44+
if (key === 'allowedHosts' && rootPath === 'server' && typeof existing === 'boolean') {
45+
continue;
46+
}
47+
4348
if (key === 'data' && rootPath === 'db') {
4449
// db.data can be a function or an array of functions. When
4550
// merging, make sure they become an array

0 commit comments

Comments
 (0)
Please sign in to comment.