Skip to content

Commit

Permalink
add URI validation to indieauth flow
Browse files Browse the repository at this point in the history
  • Loading branch information
mawise committed Jul 5, 2024
1 parent 62bd567 commit c52f07c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/indie_auth_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def initialize(client_id)
@redirects = []
if should_fetch?
begin
URI.open(client_id) do |f|
URI(client_id).open do |f|
doc = Nokogiri::HTML(f.read)

url = ""
Expand Down Expand Up @@ -66,6 +66,7 @@ def initialize(client_id)
def should_fetch?
clean_host = parse_hostname(@client_id)
begin
client_id_uri = URI.parse(@client_id) #for validation only
ip = Resolv.getaddress(clean_host)
return safe_ip? ip
rescue
Expand Down

0 comments on commit c52f07c

Please sign in to comment.