From f533c9ffe70d98e8507190889d648340c9469c6e Mon Sep 17 00:00:00 2001 From: Steven Riehl Date: Thu, 1 Dec 2022 10:52:21 -0700 Subject: [PATCH] Add user-agent for automated input requests (#13) * Add user-agent for automated input requests * Update lib/advent_of_code/input.ex Co-authored-by: Mitchell Hanberg --- lib/advent_of_code/input.ex | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/advent_of_code/input.ex b/lib/advent_of_code/input.ex index 0b2394c..5edba2d 100644 --- a/lib/advent_of_code/input.ex +++ b/lib/advent_of_code/input.ex @@ -83,5 +83,8 @@ defmodule AdventOfCode.Input do defp allow_network?, do: Keyword.get(config(), :allow_network?, false) defp headers, - do: [{'cookie', String.to_charlist("session=" <> Keyword.get(config(), :session_cookie))}] + do: [ + {'user-agent', 'github.com/mhanberg/advent-of-code-elixir-starter by aoc@mitchellhanberg.com'}, + {'cookie', String.to_charlist("session=" <> Keyword.get(config(), :session_cookie))} + ] end -- 2.43.0