mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-01-06 00:39:44 +01:00
Merge pull request #1322 from teward/idn-support
Add IDN/punycode support for non-ASCII URIs (#1319, #1320, #1321)
This commit is contained in:
commit
987bf845ad
10
testssl.sh
10
testssl.sh
@ -19340,7 +19340,15 @@ parse_cmd_line() {
|
|||||||
fatal "URI missing" $ERR_CMDLINE
|
fatal "URI missing" $ERR_CMDLINE
|
||||||
else
|
else
|
||||||
# left off here is the URI
|
# left off here is the URI
|
||||||
URI="$1"
|
if [[ $1 = *[![:ascii:]]* ]]; then
|
||||||
|
if [[ "$(command -v idn)" == "" ]]; then
|
||||||
|
fatal "URI contains non-ASCII characters, and IDN not available."
|
||||||
|
else
|
||||||
|
URI="$(echo $1 | idn)"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
URI="$1"
|
||||||
|
fi
|
||||||
# parameter after URI supplied:
|
# parameter after URI supplied:
|
||||||
[[ -n "$2" ]] && fatal "URI comes last" $ERR_CMDLINE
|
[[ -n "$2" ]] && fatal "URI comes last" $ERR_CMDLINE
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user