Skip to content

Commit

Permalink
a few more examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 21, 2013
1 parent 44857dd commit 144cead
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/Mojo/URL.pm
Expand Up @@ -83,7 +83,7 @@ sub parse {

# URL
my $proto = $self->scheme($1)->protocol;
unless ($proto && !grep { $proto eq $_ } qw(http https ws wss)) {
if (!$proto || grep { $proto eq $_ } qw(http https ws wss)) {
$self->authority($2);
$self->path->parse($3);
$self->query($4)->fragment($5);
Expand Down Expand Up @@ -368,6 +368,12 @@ Check if URL is absolute.
Parse relative or absolute URL for the C<http>, C<https>, C<ws> as well as
C<wss> schemes and preserve scheme data for all unknown ones.
# "/test/123"
$url->parse('/test/123?foo=bar')->path;
# "example.com"
$url->parse('http://example.com/test/123?foo=bar')->host;
# "mailto:sri@example.com"
$url->parse('mailto:sri@example.com')->to_string;
Expand Down

0 comments on commit 144cead

Please sign in to comment.