'Resource temporarily unavailable'.
- Fixed bug where %2b in query parameter is doubly decoded to ' ', instead of '+'
(Gavin Henry, Tatsuhiko Miyagawa)
+ - Fixed bug where req->base and req->uri would include a port number when running
+ in SSL mode.
5.7010 2007-08-22 07:41:00
- Resource forks in 5.7009
# Using URI directly is way too slow, so we construct the URLs manually
my $uri_class = "URI::$scheme";
- # HTTP_HOST will include the port even if it's 80
- $host =~ s/:80$//;
+ # HTTP_HOST will include the port even if it's 80/443
+ $host =~ s/:(?:80|443)$//;
- if ( $port != 80 && $host !~ /:/ ) {
+ if ( $port !~ /^(?:80|443)$/ && $host !~ /:/ ) {
$host .= ":$port";
}
'http://localhost/action/chained/to_root' ),
'uri_for with chained root action as arg' );
like( $response->content,
- qr(URI:http://[^/]+/),
+ qr(URI:https?://[^/]+/),
'Correct URI generated' );
}
use FindBin;
use lib "$FindBin::Bin/lib";
-use Test::More tests => 44;
+use Test::More tests => 49;
use Catalyst::Test 'TestApp';
use Catalyst::Request;
is( $creq->base . $creq->path, $creq->uri, 'Base + Path ok' );
}
+# test base is correct for HTTPS URLs
+SKIP:
+{
+ if ( $ENV{CATALYST_SERVER} ) {
+ skip 'Using remote server', 5;
+ }
+
+ local $ENV{HTTPS} = 'on';
+ ok( my $response = request('https://localhost/engine/request/uri'), 'HTTPS Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ ok( eval '$creq = ' . $response->content, 'Unserialize Catalyst::Request' );
+ is( $creq->base, 'https://localhost/', 'HTTPS base ok' );
+ is( $creq->uri, 'https://localhost/engine/request/uri', 'HTTPS uri ok' );
+}
+
# test that we can use semi-colons as separators
{
my $parameters = {
{
ok( my $response = request('http://localhost/engine/request/uri/uri_with_object'), 'Request' );
ok( $response->is_success, 'Response Successful 2xx' );
- like( $response->header( 'X-Catalyst-Param-a' ), qr(http://localhost[^/]*/), 'param "a" ok' );
+ like( $response->header( 'X-Catalyst-Param-a' ), qr(https?://localhost[^/]*/), 'param "a" ok' );
}
# test that uri_with is utf8 safe