Skip to content

Commit

Permalink
fix(build): skip udemy links validation if they return 403 http status
Browse files Browse the repository at this point in the history
  • Loading branch information
gianpaj committed Dec 3, 2017
1 parent 9053c1f commit 5e8b82e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion validate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@

def check_link(uri)
HTTParty.head(uri, :verify => false).code.to_i.tap do |status|
raise "Request had status #{status}" if (400..422).include?(status)
if (400..422).include?(status)
if status != 403 && !uri.exclude?('udemy.com')
raise "Request had status #{status}"
else
putc('S')
end
end
end
end

Expand Down

0 comments on commit 5e8b82e

Please sign in to comment.