Skip to content

Commit

Permalink
check for both nil and empty string as missing host
Browse files Browse the repository at this point in the history
Newer URI versions set host to an empty string (instead of nil) for URL like “https://”
  • Loading branch information
razumau committed May 11, 2023
1 parent 22b9bc5 commit b647c71
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/zendesk_apps_support/validations/manifest.rb
Expand Up @@ -434,7 +434,8 @@ def no_template_format_error(manifest)

def valid_url?(value)
uri = URI.parse(value)
uri.is_a?(URI::HTTP) && !uri.host.nil?
host_empty = uri.host.nil? || uri.host == ''
uri.is_a?(URI::HTTP) && !host_empty
rescue URI::InvalidURIError
false
end
Expand Down

0 comments on commit b647c71

Please sign in to comment.