From 93d44c6b8403ee2828598c63e3acd342accc8396 Mon Sep 17 00:00:00 2001 From: evazion Date: Wed, 19 Jul 2017 19:47:13 -0500 Subject: [PATCH] Fix #3224: 403 Forbidden when logging in to DeviantArt. Login fails if the User-Agent isn't set while POST'ing the login credentials. --- app/logical/sources/strategies/deviant_art.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/logical/sources/strategies/deviant_art.rb b/app/logical/sources/strategies/deviant_art.rb index 27e7f10f1..bec7e3556 100644 --- a/app/logical/sources/strategies/deviant_art.rb +++ b/app/logical/sources/strategies/deviant_art.rb @@ -142,6 +142,8 @@ module Sources def session_cookies(mech) Cache.get(DEVIANTART_SESSION_CACHE_KEY, 2.hours) do + mech.request_headers = Danbooru.config.http_headers + page = mech.get("https://www.deviantart.com/users/login") validate_key = page.search('input[name="validate_key"]').attribute("value").value validate_token = page.search('input[name="validate_token"]').attribute("value").value