1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-05 00:20: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 fi
done 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:]') HOST=$(echo "$HOST" | tr '[:upper:]' '[:lower:]')
TLD=$("$PHP" "$DIR/cli/valet.php" tld) 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" ]] if [[ $SHARETOOL = "ngrok" ]]
then then
@@ -88,8 +89,7 @@ then
fi fi
# Decide the correct PORT: uses 60 for secure, else 80 # Decide the correct PORT: uses 60 for secure, else 80
if $SECURED if [[ $SECURED -eq 0 ]]; then
then
PORT=60 PORT=60
else else
PORT=80 PORT=80
@@ -104,8 +104,7 @@ then
# expose # expose
# Decide the correct PORT: uses 443 for secure, else 80 # Decide the correct PORT: uses 443 for secure, else 80
if $SECURED if [[ $SECURED -eq 0 ]]; then
then
PORT=443 PORT=443
else else
PORT=80 PORT=80
@@ -118,8 +117,7 @@ then
elif [[ $SHARETOOL = "cloudflared" ]] elif [[ $SHARETOOL = "cloudflared" ]]
then then
# cloudflared # cloudflared
if $SECURED if [[ $SECURED -eq 0 ]]; then
then
SCHEME="https" SCHEME="https"
else else
SCHEME="http" SCHEME="http"