Skip to content

Commit 4d97c15

Browse files
committed
regexp guard tweaks for bash compatibility
1 parent a64bcca commit 4d97c15

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

resty

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ HELP
178178

179179
if [ -z "$_RESTY_HOST" ] ;then _RESTY_HOST=$(cat "$host" 2>/dev/null);fi
180180

181-
if [[ ! "$RESTY_NO_PRESERVE_PATH" =~ ^true\|yes$ ]]; then
181+
if [ "$RESTY_NO_PRESERVE_PATH" != "true" ]&&[ "$RESTY_NO_PRESERVE_PATH" != "yes" ]; then
182182
__path="${_path:-${_RESTY_PATH}}"
183183
_RESTY_PATH="${__path}"
184184
else
@@ -239,7 +239,7 @@ HELP
239239
fi
240240
if [ -n "$out" ]; then out=$(echo "$out" | eval "$display") ; fi
241241

242-
if [[ "$display" =~ ^lynx\|^elinks ]] ; then
242+
if [[ "$display" =~ ^lynx ]] || [[ "$display" =~ ^elinks ]] ; then
243243
out=$(echo "$out" |perl -e "\$host='$(echo "$_RESTY_HOST" |sed 's/^\(https*:\/\/[^\/*]*\).*$/\1/')';" \
244244
-e "$(cat <<'PERL'
245245
@a=<>;

test/resty_shpec.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ describe "Resty"
196196
GET /echo > /dev/null
197197
assert equal "$_RESTY_PATH" ""
198198
output=$(GET 2>&1)
199-
assert equal "$output" '{"statusCode":403,"error":"Forbidden"}'
199+
assert grep "$output" '{"statusCode":403'
200200
RESTY_NO_PRESERVE_PATH="no"
201201
end
202202
end

0 commit comments

Comments
 (0)