Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 2 of 2 total |
how to ensure HTTPS |
Tue, Feb 16 2016 9:17 AM | Permanent Link |
erickengelke | Hi, this is my first contribution BACK to EWS. If you are passing passwords and the like, you will want to be sure to use HTTPS. This code will test for HTTPS and convert to HTTPS if not running on the local machine (ie. debugging)
function CheckHTTPS: boolean; var hostname : string; protocol : string; begin protocol := LowerCase(window.location.protocol); hostname := LowerCase(window.location.hostname); result := ( hostname = 'localhost') or ( protocol = 'https:'); end; procedure MakeHTTPS; var s : string; hostname, port, search : string; pathname , name : string; begin if not CheckHTTPS then begin hostname := window.location.hostname; port := window.location.port; search := window.location.search; pathname := window.location.pathname; s := 'https:' + hostname; if ( port <> '' ) then s := s + ':'+ port; if (pathname <> '') then s := s + '/' + pathname; window.location.replace( s ); end; end; |
Tue, Feb 16 2016 9:44 AM | Permanent Link |
erickengelke | erickengelke wrote:
> If you are passing passwords and the like, you will want to be sure to use HTTPS. The correct code is: function CheckHTTPS: boolean; var hostname : string; protocol : string; begin protocol := LowerCase(window.location.protocol); hostname := LowerCase(window.location.hostname); result := ( hostname = 'localhost') or ( protocol = 'https:'); end; procedure MakeHTTPS; var s : string; hostname, port, search : string; pathname , name : string; begin if not CheckHTTPS then begin hostname := window.location.hostname; port := window.location.port; search := window.location.search; pathname := window.location.pathname; s := 'https:' + hostname; if ( port <> '' ) then s := s + ':'+ port; if (pathname <> '') then s := s + pathname; if ( search <> '' ) then s := s + search; window.location.replace( s ); end; end; |
This web page was last updated on Friday, November 1, 2024 at 07:01 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |