0

My rails app is experiencing something that has me confused. A few pages in the Rails app render content from another domain using Net::HTTP.get_resonse. So, alpha.example.com/pages/terms displays content received from www.example.com/terms.

render text: Net::HTTP.get_response("www.example.com", "/terms/").body

About 70% of the time, this works flawlessly. The other 30%, it return completely blank BUT claims "302 Found".

How could this be? If it means anything, the source website (www.example.com) is hosted on GitHub pages. Happens in both development and production.

sman591
  • 540
  • 6
  • 19
  • 1
    Do you experience the same thing when loading content from a different domain/server? Is it the remote server that responds with a 302 or is it your server? – zwippie Feb 18 '14 at 23:30
  • It seems to be just my domain - but like I said, it's not like the request is failing... I've tried with other websites also hosted on GitHub pages, but they seem to work fine too – sman591 Feb 18 '14 at 23:42
  • so is it YOUR website or example.com? is it http https? – phoet Feb 19 '14 at 02:15
  • My website, http. When loaded using a browser, it loads just fine every time, but not so when requested by rails. – sman591 Feb 19 '14 at 03:56

0 Answers0