Skip to content
This repository was archived by the owner on Jun 27, 2020. It is now read-only.

Support for reddit forced SSL accounts #35

@blakejakopovic

Description

@blakejakopovic

When a reddit user enables forced SSL, it seems to break the API. I've tested it using the save and unsave methods on a post. It returns a 307 redirect, and the method fails. I'm not sure what's involved to get this working. For now the fix is to disable forced SSL for the account.

#<struct Faraday::Env
 method=:post,
 body=
  "<html>\n <head>\n  <title>307 Temporary Redirect</title>\n </head>\n <body>\n  <h1>307 Temporary Redirect</h1>\n  The resource has been moved to <a href=\"https://reddit.com/modify_hsts_grant?dest=https%3A%2F%2Fwww.reddit.com%2Fapi%2Funsave\">https://reddit.com/modify_hsts_grant?dest=https%3A%2F%2Fwww.reddit.com%2Fapi%2Funsave</a>;\nyou should be redirected automatically.\n\n\n </body>\n</html>",
 url=#<URI::HTTP:0x007faa52847bb0 URL:http://www.reddit.com/api/unsave>,
 request=
  #<struct Faraday::RequestOptions
   params_encoder=nil,
   proxy=nil,
   bind=nil,
   timeout=nil,
   open_timeout=nil,
   boundary=nil,
   oauth=nil>,
 request_headers=
  {"User-Agent"=>"Faraday v0.9.0",
   "Cookie"=>
    "reddit_session=XXXXXXXXXXXXX",
   "X-Modhash"=>"XXXXXXXXXXXXX",
   "Content-Type"=>"application/x-www-form-urlencoded"},
 ssl=
  #<struct Faraday::SSLOptions
   verify=nil,
   ca_file=nil,
   ca_path=nil,
   verify_mode=nil,
   cert_store=nil,
   client_cert=nil,
   client_key=nil,
   certificate=nil,
   private_key=nil,
   verify_depth=nil,
   version=nil>,
 parallel_manager=nil,
 params=nil,
 response=nil,
 response_headers=
  {"date"=>"Tue, 28 Oct 2014 00:43:20 GMT",
   "content-type"=>"text/html; charset=UTF-8",
   "transfer-encoding"=>"chunked",
   "connection"=>"close",
   "set-cookie"=>
    "XXXXXXXXXXXXX; path=/; domain=.reddit.com; HttpOnly",
   "pragma"=>"no-cache",
   "cache-control"=>"no-cache, no-cache",
   "location"=>
    "https://reddit.com/modify_hsts_grant?dest=https%3A%2F%2Fwww.reddit.com%2Fapi%2Funsave",
   "x-ua-compatible"=>"IE=edge",
   "x-moose"=>"majestic",
   "server"=>"cloudflare-nginx",
   "cf-ray"=>"XXXXXXXXXXXXX"},
 status=307>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions