Skip to content

Instantly share code, notes, and snippets.

@sam0x17
Created November 29, 2016 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sam0x17/fbb0c1c2d6dfe929dc74cf4617647f0e to your computer and use it in GitHub Desktop.
Save sam0x17/fbb0c1c2d6dfe929dc74cf4617647f0e to your computer and use it in GitHub Desktop.
force ssl on rails google app engine
index = window.location.href.indexOf('localhost')
index2 = window.location.href.indexOf('127.0.0.1')
if window.location.protocol != 'https:' && !(index > -1 || index2 > -1)
window.location.href = 'https:' + window.location.href.substring(window.location.protocol.length)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment