Fix #3224: 403 Forbidden when logging in to DeviantArt.

Login fails if the User-Agent isn't set while POST'ing the login
credentials.
This commit is contained in:
evazion
2017-07-19 19:47:13 -05:00
parent 8125d8e796
commit 93d44c6b84

View File

@@ -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