Skip to content

Commit

Permalink
small optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 3, 2013
1 parent 490057b commit b092699
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
3 changes: 3 additions & 0 deletions Changes
@@ -1,4 +1,7 @@

3.89 2013-03-04
- Improved documentation.

3.88 2013-03-03
- Improved Mojo::Path to delay normalization as long as possible.
- Improved Mojo::Path performance.
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/Headers.pm
Expand Up @@ -500,8 +500,8 @@ Shortcut for the C<Sec-WebSocket-Key> header from RFC 6455.
=head2 sec_websocket_protocol
my $protocol = $headers->sec_websocket_protocol;
$headers = $headers->sec_websocket_protocol('sample');
my $proto = $headers->sec_websocket_protocol;
$headers = $headers->sec_websocket_protocol('sample');
Shortcut for the C<Sec-WebSocket-Protocol> header from RFC 6455.
Expand Down
7 changes: 3 additions & 4 deletions lib/Mojo/UserAgent/Transactor.pm
Expand Up @@ -155,10 +155,9 @@ sub websocket {

# New WebSocket transaction
my $tx = $self->tx(GET => @_);
my $req = $tx->req;
my $abs = $req->url->to_abs;
my $proto = $abs->protocol;
$req->url($abs->scheme($proto eq 'wss' ? 'https' : 'http')) if $proto;
my $url = $tx->req->url;
my $proto = $url->protocol;
$url->scheme($proto eq 'wss' ? 'https' : 'http') if $proto;

# Handshake
Mojo::Transaction::WebSocket->new(handshake => $tx)->client_handshake;
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious.pm
Expand Up @@ -40,7 +40,7 @@ has static => sub { Mojolicious::Static->new };
has types => sub { Mojolicious::Types->new };

our $CODENAME = 'Rainbow';
our $VERSION = '3.88';
our $VERSION = '3.89';

sub AUTOLOAD {
my $self = shift;
Expand Down

0 comments on commit b092699

Please sign in to comment.