/usr/share/perl5/Mojo/Cookie/Request.pm is in libmojolicious-perl 7.59+dfsg-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | package Mojo::Cookie::Request;
use Mojo::Base 'Mojo::Cookie';
use Mojo::Util qw(quote split_header);
sub parse {
my ($self, $str) = @_;
my @cookies;
my @pairs = map {@$_} @{split_header $str // ''};
while (my ($name, $value) = splice @pairs, 0, 2) {
next if $name =~ /^\$/;
push @cookies, $self->new(name => $name, value => $value // '');
}
return \@cookies;
}
sub to_string {
my $self = shift;
return '' unless length(my $name = $self->name // '');
my $value = $self->value // '';
return join '=', $name, $value =~ /[,;" ]/ ? quote $value : $value;
}
1;
=encoding utf8
=head1 NAME
Mojo::Cookie::Request - HTTP request cookie
=head1 SYNOPSIS
use Mojo::Cookie::Request;
my $cookie = Mojo::Cookie::Request->new;
$cookie->name('foo');
$cookie->value('bar');
say "$cookie";
=head1 DESCRIPTION
L<Mojo::Cookie::Request> is a container for HTTP request cookies, based on
L<RFC 6265|http://tools.ietf.org/html/rfc6265>.
=head1 ATTRIBUTES
L<Mojo::Cookie::Request> inherits all attributes from L<Mojo::Cookie>.
=head1 METHODS
L<Mojo::Cookie::Request> inherits all methods from L<Mojo::Cookie> and
implements the following new ones.
=head2 parse
my $cookies = Mojo::Cookie::Request->parse('f=b; g=a');
Parse cookies.
=head2 to_string
my $str = $cookie->to_string;
Render cookie.
=head1 SEE ALSO
L<Mojolicious>, L<Mojolicious::Guides>, L<http://mojolicious.org>.
=cut
|