mirror of
				https://github.com/drwetter/testssl.sh.git
				synced 2025-10-31 13:55:25 +01:00 
			
		
		
		
	Merge pull request #2644 from testssl/fix_2642
Fix error when hostname w trailing dot supplied
This commit is contained in:
		| @@ -21255,7 +21255,7 @@ parse_hn_port() { | |||||||
|      NODE="$1" |      NODE="$1" | ||||||
|      NODE="${NODE/https\:\/\//}"        # strip "https" |      NODE="${NODE/https\:\/\//}"        # strip "https" | ||||||
|      NODE="${NODE%%/*}"                 # strip trailing urlpath |      NODE="${NODE%%/*}"                 # strip trailing urlpath | ||||||
|      NODE="${NODE%%.}"                  # strip trailing "." if supplied | 
 | ||||||
|      if grep -q ':$' <<< "$NODE"; then |      if grep -q ':$' <<< "$NODE"; then | ||||||
|           if grep -wq http <<< "$NODE"; then |           if grep -wq http <<< "$NODE"; then | ||||||
|                fatal "\"http\" is not what you meant probably" $ERR_CMDLINE |                fatal "\"http\" is not what you meant probably" $ERR_CMDLINE | ||||||
| @@ -21278,6 +21278,8 @@ parse_hn_port() { | |||||||
|                PORT=$(sed 's/^.*\://' <<< "$NODE") && NODE=$(sed 's/\:.*$//' <<< "$NODE") |                PORT=$(sed 's/^.*\://' <<< "$NODE") && NODE=$(sed 's/\:.*$//' <<< "$NODE") | ||||||
|      fi |      fi | ||||||
| 
 | 
 | ||||||
|  |      NODE="${NODE%%.}"                  # strip trailing "." if supplied | ||||||
|  | 
 | ||||||
|      # We check for non-ASCII chars now. If there are some we'll try to convert it if IDN/IDN2 is installed |      # We check for non-ASCII chars now. If there are some we'll try to convert it if IDN/IDN2 is installed | ||||||
|      # If not, we'll continue. Hoping later that dig can use it. If not the error handler will tell |      # If not, we'll continue. Hoping later that dig can use it. If not the error handler will tell | ||||||
|      # Honestly we don't care whether it's IDN2008 or IDN2003 or Emoji domains as long as it works. |      # Honestly we don't care whether it's IDN2008 or IDN2003 or Emoji domains as long as it works. | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Dirk Wetter
					Dirk Wetter