1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-04 16:10:08 +01:00

Fix failing extraction of secured domain check

Co-Authored-By: Mateus Junges <mateus@junges.dev>
This commit is contained in:
Matt Stauffer
2024-08-24 22:19:59 -05:00
parent 374eaa0d59
commit 3e2789c24e

14
valet
View File

@@ -70,10 +70,11 @@ then
fi
done
# Lowercase the host to match the rest of our domains are looked up
# Lowercase the host to match how the rest of our domains are looked up
HOST=$(echo "$HOST" | tr '[:upper:]' '[:lower:]')
TLD=$("$PHP" "$DIR/cli/valet.php" tld)
SECURED=$(grep --quiet --no-messages 443 ~/.config/valet/Nginx/$HOST*)
$(grep --quiet --no-messages 443 ~/.config/valet/Nginx/$HOST*)
SECURED=$?
if [[ $SHARETOOL = "ngrok" ]]
then
@@ -88,8 +89,7 @@ then
fi
# Decide the correct PORT: uses 60 for secure, else 80
if $SECURED
then
if [[ $SECURED -eq 0 ]]; then
PORT=60
else
PORT=80
@@ -104,8 +104,7 @@ then
# expose
# Decide the correct PORT: uses 443 for secure, else 80
if $SECURED
then
if [[ $SECURED -eq 0 ]]; then
PORT=443
else
PORT=80
@@ -118,8 +117,7 @@ then
elif [[ $SHARETOOL = "cloudflared" ]]
then
# cloudflared
if $SECURED
then
if [[ $SECURED -eq 0 ]]; then
SCHEME="https"
else
SCHEME="http"