Skip to content

Commit 2f78f1a

Browse files
committed
fix(local): treat 127.0.0.1 as local also
`sam local start-api` (SAM CLI, version 0.16.0) returned http://127.0.0.1:3000 as the localhost URL (not http://localhost:3000)
1 parent 4f31cb7 commit 2f78f1a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/proxyIntegration.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ function extractPathNames(pathExpression) {
196196
function isLocalExecution(event) {
197197
return event.headers
198198
&& event.headers.Host
199-
&& event.headers.Host.startsWith('localhost');
199+
&& event.headers.Host.startsWith('localhost') || event.headers.Host.startsWith('127.0.0.1');
200200
}
201201

202202
module.exports = process;

0 commit comments

Comments
 (0)