diff options
| author | Dan Langille <dvl@FreeBSD.org> | 2022-04-25 13:14:20 +0000 |
|---|---|---|
| committer | Dan Langille <dvl@FreeBSD.org> | 2022-04-25 13:17:03 +0000 |
| commit | 6a7814d1394361b14c5fb6f1dc8e0d3ae02dd003 (patch) | |
| tree | ec6466936cd25820b154a001cdade8ffd95f1f68 | |
| parent | 45f1b936769d8038de890dda01ce7986a94bbbe6 (diff) | |
www/p5-URI-Normalize: Add new port
::Normalize normalizes URIs according to RFC 3986.
This has a number of useful applications in allowing URIs to be compared with
fewer false negatives. For example, all of the following URIs will normalize to
the same value:
HTTPS://www.example.com:443/../test/../foo/index.html
https://WWW.EXAMPLE.COM/./foo/index.html
https://www.example.com/%66%6f%6f/index.html
https://www.example.com/foo/index.html
That is, they will all be normalized into the last value.
Example:
use URI;
use URI::Normalize qw( normalize_uri remove_dot_segments );
my $uri = URI->new('HTTPS://www.Example.com:443/../test/../foo/index.html');
say normalize_uri($uri); #> https://www.example.com/foo/index.html
say remove_dot_segments($uri); #> HTTPS://www.Example.com:443/foo/index.html
WWW: https://metacpan.org/pod/URI::Normalize
| -rw-r--r-- | www/Makefile | 1 | ||||
| -rw-r--r-- | www/p5-URI-Normalize/Makefile | 21 | ||||
| -rw-r--r-- | www/p5-URI-Normalize/distinfo | 3 | ||||
| -rw-r--r-- | www/p5-URI-Normalize/pkg-descr | 23 | ||||
| -rw-r--r-- | www/p5-URI-Normalize/pkg-plist | 2 |
5 files changed, 50 insertions, 0 deletions
diff --git a/www/Makefile b/www/Makefile index 572ef34a7fc3..ad35bf9c9c13 100644 --- a/www/Makefile +++ b/www/Makefile @@ -1193,6 +1193,7 @@ SUBDIR += p5-URI-Escape-JavaScript SUBDIR += p5-URI-Escape-XS SUBDIR += p5-URI-Fetch + SUBDIR += p5-URI-Normalize SUBDIR += p5-URI-ParseSearchString SUBDIR += p5-URI-Sequin SUBDIR += p5-URI-Title diff --git a/www/p5-URI-Normalize/Makefile b/www/p5-URI-Normalize/Makefile new file mode 100644 index 000000000000..d153569e0eba --- /dev/null +++ b/www/p5-URI-Normalize/Makefile @@ -0,0 +1,21 @@ +PORTNAME= URI-Normalize +PORTVERSION= 0.002 +CATEGORIES= www perl5 +MASTER_SITES= CPAN +PKGNAMEPREFIX= p5- + +MAINTAINER= dvl@FreeBSD.org +COMMENT= Normalize URIs according to RFC 3986 + +LICENSE= GPLv1 ART10 +LICENSE_COMB= dual +LICENSE_FILE= ${WRKSRC}/LICENSE + +RUN_DEPENDS= p5-URI>0:net/p5-URI + +USES= perl5 + +NO_ARCH= yes +USE_PERL5= configure + +.include <bsd.port.mk> diff --git a/www/p5-URI-Normalize/distinfo b/www/p5-URI-Normalize/distinfo new file mode 100644 index 000000000000..0b2646d2e496 --- /dev/null +++ b/www/p5-URI-Normalize/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1650631625 +SHA256 (URI-Normalize-0.002.tar.gz) = e08b96b53f45bc2e4b1ffb1eddbbf85ae89e6177c7ad79ea112a2b92040b1e83 +SIZE (URI-Normalize-0.002.tar.gz) = 10825 diff --git a/www/p5-URI-Normalize/pkg-descr b/www/p5-URI-Normalize/pkg-descr new file mode 100644 index 000000000000..fb3526db427b --- /dev/null +++ b/www/p5-URI-Normalize/pkg-descr @@ -0,0 +1,23 @@ +URI::Normalize normalizes URIs according to RFC 3986. + +This has a number of useful applications in allowing URIs to be compared with +fewer false negatives. For example, all of the following URIs will normalize to +the same value: + +HTTPS://www.example.com:443/../test/../foo/index.html +https://WWW.EXAMPLE.COM/./foo/index.html +https://www.example.com/%66%6f%6f/index.html +https://www.example.com/foo/index.html + +That is, they will all be normalized into the last value. + +Example: + +use URI; +use URI::Normalize qw( normalize_uri remove_dot_segments ); +my $uri = URI->new('HTTPS://www.Example.com:443/../test/../foo/index.html'); + +say normalize_uri($uri); #> https://www.example.com/foo/index.html +say remove_dot_segments($uri); #> HTTPS://www.Example.com:443/foo/index.html + +WWW: https://metacpan.org/pod/URI::Normalize diff --git a/www/p5-URI-Normalize/pkg-plist b/www/p5-URI-Normalize/pkg-plist new file mode 100644 index 000000000000..fd7122b33775 --- /dev/null +++ b/www/p5-URI-Normalize/pkg-plist @@ -0,0 +1,2 @@ +%%SITE_PERL%%/URI/Normalize.pm +%%PERL5_MAN3%%/URI::Normalize.3.gz |
