IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6609


Ignore:
Timestamp:
Mar 16, 2006, 12:00:29 PM (20 years ago)
Author:
jhoblitt
Message:

be consistent about how HTTP URIs are validated

Location:
trunk/DataStore/lib/DataStore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataStore/lib/DataStore/File/Parser.pm

    r6604 r6609  
    11# Copyright (C) 2006  Joshua Hoblitt
    22#
    3 # $Id: Parser.pm,v 1.8 2006-03-16 21:48:50 jhoblitt Exp $
     3# $Id: Parser.pm,v 1.9 2006-03-16 22:00:29 jhoblitt Exp $
    44
    55package DataStore::File::Parser;
     
    1414
    1515use Carp qw( carp );
     16use Data::Validate::URI qw( is_uri );
    1617use DataStore::File;
    1718use Params::Validate qw( validate validate_pos SCALAR );
     
    9192                type        => SCALAR,
    9293                callbacks   => {
    93                     'is valid http uri' => sub { is_http_uri($_[0]) },
     94                    'is valid http uri' =>
     95                        sub { is_uri($_[0]) and $_[0] =~ /^http:/ },
    9496                },
    9597                default =>  'http://example.org/',
  • trunk/DataStore/lib/DataStore/FileSet/Parser.pm

    r6605 r6609  
    11# Copyright (C) 2006  Joshua Hoblitt
    22#
    3 # $Id: Parser.pm,v 1.10 2006-03-16 21:50:09 jhoblitt Exp $
     3# $Id: Parser.pm,v 1.11 2006-03-16 22:00:29 jhoblitt Exp $
    44
    55package DataStore::FileSet::Parser;
     
    1414
    1515use Carp qw( carp );
    16 use Data::Validate::URI qw( is_http_uri );
     16use Data::Validate::URI qw( is_uri );
    1717use DataStore::FileSet;
    1818use Params::Validate qw( validate validate_pos SCALAR);
     
    9090                type        => SCALAR,
    9191                callbacks   => {
    92                     'is valid http uri' => sub { is_http_uri($_[0]) },
     92                    'is valid http uri' =>
     93                        sub { is_uri($_[0]) and $_[0] =~ /^http:/ },
    9394                    'uri ends with /'   => sub { $_[0] =~ m|/$| },
    9495                },
Note: See TracChangeset for help on using the changeset viewer.