]> git.njae.me.uk Git - advent-of-code-24-elixir.git/commitdiff
Add user-agent for automated input requests (#13)
authorSteven Riehl <sr@stevenriehl.com>
Thu, 1 Dec 2022 17:52:21 +0000 (10:52 -0700)
committerGitHub <noreply@github.com>
Thu, 1 Dec 2022 17:52:21 +0000 (12:52 -0500)
* Add user-agent for automated input requests

* Update lib/advent_of_code/input.ex

Co-authored-by: Mitchell Hanberg <mitch@mitchellhanberg.com>
lib/advent_of_code/input.ex

index 0b2394ca469f83b45dcf44724efc5a4508ea1651..5edba2d4d30300ba82e9b0f68758b584927a8ce7 100644 (file)
@@ -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