From dd512d2e0d6cf2029984cb6899f77fbd6598ed88 Mon Sep 17 00:00:00 2001 From: Emily Samp Date: Thu, 1 Dec 2022 16:14:25 -0600 Subject: [PATCH] Provide information identifying this tool when making the automated request in the download command. --- lib/advent_of_code_cli/commands/download.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/advent_of_code_cli/commands/download.rb b/lib/advent_of_code_cli/commands/download.rb index 1407fda..9f7707e 100644 --- a/lib/advent_of_code_cli/commands/download.rb +++ b/lib/advent_of_code_cli/commands/download.rb @@ -46,6 +46,9 @@ def fetch_input request = Net::HTTP::Get.new(url) request["Cookie"] = "session=#{cookie}" + # The creator of Advent of Code has requested that automated tools send identifying information + # when making requests: https://www.reddit.com/r/adventofcode/comments/z9dhtd + request["User-Agent"] = "github.com/egiurleo/advent_of_code_cli by emily.samp@icloud.com" response = https.request(request) response.read_body