Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using some special characters in http authentication broke URI parsing #143

Open
kastakhov opened this issue Aug 17, 2024 · 0 comments
Open

Comments

@kastakhov
Copy link

URI lib cannot correctly parse next URI if its contain '#/?' symbols.
For instance, next code:

use strict;
use warnings;
use v5.10;

use URI;

my $username = 'u1!"#$%&\'()*+,-./;<=>?@[\]^_`{|}~';
my $password = 'p2!"#$%&\'()*+,-./;<=>?@[\]^_`{|}~';
my $host = 'localhost';
my $port = '8080';

my $uri = URI->new("http://${username}:${password}\@${host}:${port}/path/to/file");
say $uri->scheme;
say $uri->host;
say $uri->port;
say $uri->path;
say $uri->authority;
say $uri->userinfo;

Produce the next output:

me@rogflowx13:~/libwww-perl$ perl test.pl
http
u1!"
80

u1!%22
Use of uninitialized value in say at test.pl line 25.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant