Skip to content

Commit

Permalink
Provide information identifying this tool when making the automated
Browse files Browse the repository at this point in the history
request in the download command.
  • Loading branch information
egiurleo committed Dec 1, 2022
1 parent 91f547f commit dd512d2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/advent_of_code_cli/commands/download.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dd512d2

Please sign in to comment.