Skip to content

Commit

Permalink
Merge pull request #1417 from da2x/patch-2
Browse files Browse the repository at this point in the history
Set a User-Agent for HTTP requests from :elinks
  • Loading branch information
denisdefreyne committed Apr 27, 2019
2 parents e3a75e2 + f0a8a6a commit 7410fed
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions nanoc/lib/nanoc/checking/checks/external_links.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ def path_for_url(url)

def request_url_once(url)
req = Net::HTTP::Get.new(path_for_url(url))
req['User-Agent'] = "Mozilla/5.0 Nanoc/#{Nanoc::VERSION} (link rot checker)"
http = Net::HTTP.new(url.host, url.port)
if url.instance_of? URI::HTTPS
http.use_ssl = true
Expand Down

0 comments on commit 7410fed

Please sign in to comment.