[Jifty-commit] jifty branch, master, updated. 960a352a723886329d27ef5880fa7c2c96765053

Jifty commits jifty-commit at lists.jifty.org
Mon Jun 14 13:08:11 EDT 2010


The branch, master has been updated
       via  960a352a723886329d27ef5880fa7c2c96765053 (commit)
      from  a72b885900196715ac72705f8312f15f508715cc (commit)

Summary of changes:
 lib/Jifty/Web.pm |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

- Log -----------------------------------------------------------------
commit 960a352a723886329d27ef5880fa7c2c96765053
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Mon Jun 14 13:05:45 2010 -0400

    Inspect callers to default to http urls for emails
    
    This is a decently reasonable way to magically DWIW with generated urls,
    but replacing it with a better solution would be good.

diff --git a/lib/Jifty/Web.pm b/lib/Jifty/Web.pm
index 344ac4d..d254225 100644
--- a/lib/Jifty/Web.pm
+++ b/lib/Jifty/Web.pm
@@ -149,6 +149,16 @@ sub url {
     # https is sticky
     $uri->scheme('https') if $uri->scheme eq 'http' && Jifty->web->is_ssl;
 
+    # If we're generating a URL from an email (really a Jifty::Notification
+    # subclass), default to http
+    my $level = 0;
+    while ( my $class = caller($level++) ) {
+        if ( $class->isa("Jifty::Notification") ) {
+            $uri->scheme('http');
+            last;
+        }
+    }
+
     $uri->scheme( $args{'scheme'} ) if defined $args{'scheme'};
 
     return $uri->canonical->as_string;

-----------------------------------------------------------------------


More information about the Jifty-commit mailing list