Skip to content

Commit b15dfeb

Browse files
committed
More copilot feedback
1 parent 3b7afe6 commit b15dfeb

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

app/controllers/thirdiron_controller.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,17 @@ def expected_params?
2626
end
2727

2828
def safe_full_record_url(url)
29+
return nil unless url.is_a?(String)
30+
31+
url = url.strip
2932
return nil if url.blank?
3033

3134
parsed = URI.parse(url)
3235
return nil unless parsed.is_a?(URI::HTTP) || parsed.is_a?(URI::HTTPS)
3336
return nil if parsed.host.blank?
3437

3538
parsed.to_s
36-
rescue URI::InvalidURIError
39+
rescue URI::InvalidURIError, ArgumentError
3740
nil
3841
end
3942
end

0 commit comments

Comments
 (0)