precheck/lib/precheck/rules/unreachable_urls_rule.rb in fastlane-2.65.0.beta.20171113010004 vs precheck/lib/precheck/rules/unreachable_urls_rule.rb in fastlane-2.65.0.beta.20171114010003
- old
+ new
@@ -22,10 +22,12 @@
return lambda { |url|
url = url.to_s.strip
return RuleReturn.new(validation_state: Precheck::VALIDATION_STATES[:failed], failure_data: "empty url") if url.empty?
begin
- request = Faraday.new(URI.encode(url)) do |connection|
+ uri = Addressable::URI.parse(url)
+ uri.fragment = nil
+ request = Faraday.new(URI.encode(uri.to_s)) do |connection|
connection.use FaradayMiddleware::FollowRedirects
connection.adapter :net_http
end
return RuleReturn.new(validation_state: Precheck::VALIDATION_STATES[:failed], failure_data: url) unless request.head.status == 200
rescue