Skip to content

Commit 6dc9992

Browse files
authored
refactor: simplify for loops to for...of in Server.js (#5496)
1 parent 237d918 commit 6dc9992

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/Server.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3123,10 +3123,7 @@ class Server {
31233123
// always allow localhost host, for convenience
31243124
// allow if value is in allowedHosts
31253125
if (Array.isArray(allowedHosts) && allowedHosts.length > 0) {
3126-
for (let hostIdx = 0; hostIdx < allowedHosts.length; hostIdx++) {
3127-
/** @type {string} */
3128-
const allowedHost = allowedHosts[hostIdx];
3129-
3126+
for (const allowedHost of allowedHosts) {
31303127
if (allowedHost === value) {
31313128
return true;
31323129
}

0 commit comments

Comments
 (0)