ucla-oarc-mobile / mwf

UCLA Mobile Web Framework
http://mwf.ucla.edu
Other
86 stars 25 forks source link

Protocol-less redirects #147

Closed jeffpignataro closed 12 years ago

jeffpignataro commented 12 years ago

I currently have a site which is, at the moment, entirely secured (via IIS redirect to HTTPS). As such, my async redirect is pointing at the HTTPS version of the site. I was curious, if we decided to go with a more common blended approach with the vast majority of pages being un-secure and only securing those with purchasing components on them, would it be an option to use a protocol-less url for the redirect?

I see that currently the redirect.js uses window.location which to my knowledge requires a protocol. Would it be possible to adjust it to detect protocol if one is not supplied? Or would the prudent thing to do be to do my protocol checking prior to executing the async redirect and handle that on my side?

Thanks for your help. You guys do really great work!!

Trott commented 12 years ago

window.location accepts protocol-less URLs, at least on the small set of things I've tested. If you have a browser/device that does not work with http://jsfiddle.net/wgqDN/, I'd be very interested to know!

jeffpignataro commented 12 years ago

Hmm perhaps my markup was incorrect then. I was trying to use http://jsfiddle.net/NWXa5/ and it didn't seem to work, although I just recreated it and now it appears to be working. I guess I jumped the gun on the issue. Thanks!