[Jifty-commit] jifty branch, master, updated. d9e13544847ea97364a17cfd3320f1527806820d

Jifty commits jifty-commit at lists.jifty.org
Fri Apr 30 19:43:17 EDT 2010


The branch, master has been updated
       via  d9e13544847ea97364a17cfd3320f1527806820d (commit)
      from  837788395ad25574ab070a50e51bd2dee82594c6 (commit)

Summary of changes:
 lib/Jifty/Web.pm |    2 ++
 t/09-url.t       |    3 ++-
 2 files changed, 4 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit d9e13544847ea97364a17cfd3320f1527806820d
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Fri Apr 30 19:42:08 2010 -0400

    Fix setting scheme when calling Jifty->web->url
    
    769c800f broke it, but now we have a basic test

diff --git a/lib/Jifty/Web.pm b/lib/Jifty/Web.pm
index edfba40..cc9e512 100644
--- a/lib/Jifty/Web.pm
+++ b/lib/Jifty/Web.pm
@@ -150,6 +150,8 @@ sub url {
     # https is sticky
     $uri->scheme('https') if $uri->scheme eq 'http' && Jifty->web->is_ssl;
 
+    $uri->scheme( $args{'scheme'} ) if defined $args{'scheme'};
+
     return $uri->canonical->as_string;
 }
 
diff --git a/t/09-url.t b/t/09-url.t
index a8b52c8..81310bf 100644
--- a/t/09-url.t
+++ b/t/09-url.t
@@ -10,11 +10,12 @@ Tests that URLs constructed with Jifty->web->url are correct
 
 =cut
 
-use Jifty::Test tests => 5;
+use Jifty::Test tests => 6;
 
 like(Jifty->web->url, qr{^http://localhost:\d+/$}, 'basic call works');
 like(Jifty->web->url(path => 'foo/bar'), qr{^http://localhost:\d+/foo/bar$}, 'path works');
 like(Jifty->web->url(path => '/foo/bar'), qr{^http://localhost:\d+/foo/bar$}, 'path with leading slash works');
+like(Jifty->web->url( scheme => 'https' ), qr{^https://localhost:\d+/$}, 'setting https scheme works');
 
 Jifty::Handler->add_trigger(
     have_request => sub {

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


More information about the Jifty-commit mailing list