Francois Gouget : testbot: Document SecureConnection() and MakeSecureURL().
Module: tools Branch: master Commit: 00fe5045513e213d54c87f1a1e43d8f38a6d6a48 URL: https://source.winehq.org/git/tools.git/?a=commit;h=00fe5045513e213d54c87f1a... Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Fri Apr 1 17:09:41 2022 +0200 testbot: Document SecureConnection() and MakeSecureURL(). Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- testbot/lib/WineTestBot/Utils.pm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/testbot/lib/WineTestBot/Utils.pm b/testbot/lib/WineTestBot/Utils.pm index 5315c75..d93a938 100644 --- a/testbot/lib/WineTestBot/Utils.pm +++ b/testbot/lib/WineTestBot/Utils.pm @@ -42,11 +42,38 @@ use WineTestBot::Config; # Web helpers # +=pod +=over 12 + +=item C<SecureConnection()> + +Returns true if the user accessed the website over a secure connection. + +This relies on the web server setting the $HTTPS environment variable. + +=back +=cut + sub SecureConnection() { return defined($ENV{"HTTPS"}) && $ENV{"HTTPS"} eq "on"; } +=pod +=over 12 + +=item C<MakeSecureURL()> + +Builds a URL that accesses this website using https if possible. +The parameter should be an absolute path that includes neither the protocol +nor the hostname. + +Note that this method uses $HTTP_HOST which may not match the official website +hostname. As such this should only be used for providing URLs back to the user +accessing the website, not for URLs sent to third-parties. + +=back +=cut sub MakeSecureURL($) { my ($URL) = @_;
participants (1)
-
Alexandre Julliard