view release on metacpan or search on metacpan
lib/EBook/Ishmael/EBook/FictionBook2.pm view on Meta::CPAN
}
}
}
for my $n ($xpc->findnodes('/FictionBook:FictionBook/FictionBook:binary')) {
my $mime = $n->getAttribute('content-type');
next if not defined $mime;
my $format = mimetype_id($mime);
next if not defined $format;
push @{ $self->{_images} }, [ $n, $format ];
}
lib/EBook/Ishmael/EBook/FictionBook2.pm view on Meta::CPAN
my $href = $img->getAttribute('l:href') or last;
$href =~ s/^#//;
my ($binary) = $xpc->findnodes(
"/FictionBook:FictionBook/FictionBook:binary[\@id=\"$href\"]"
) or last;
my $mime = $binary->getAttribute('content-type');
last if not defined $mime;
my $format = mimetype_id($mime);
last if not defined $format;
$self->{_cover} = [ $binary, $format ];
}}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/EBook/Tools.pm view on Meta::CPAN
}
$output = $xmeta->first_child('output');
if($output) {
my $encoding = $mobiencodings{$output->att('encoding')};
my $contenttype = $mobicontenttypes{$output->att('content-type')};
if($contenttype) {
$output->set_att('encoding','utf-8') if(!$encoding);
debug(2,"DEBUG: setting encoding only and returning");
return 1;
lib/EBook/Tools.pm view on Meta::CPAN
# At this stage, we definitely have <output> in the right place.
# Set the attributes and return.
$output->set_att('encoding' => 'utf-8',
'content-type' => 'text/x-oeb1-document');
debug(2,"DEBUG[/",$subname,"]");
return 1;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/EPublisher/Source/Plugin/MetaCPAN.pm view on Meta::CPAN
my $result;
eval {
$result = $mcpan->pod(
module => $release_name_metacpan,
'content-type' => 'text/x-pod',
);
1;
} or do {
$self->publisher->debug(
"103: Can't retrieve pod for $release_name_metacpan"
lib/EPublisher/Source/Plugin/MetaCPAN.pm view on Meta::CPAN
eval {
$pod_src = $mcpan->pod(
author => $module_result->{author},
release => $module_result->{name},
path => $file,
'content-type' => 'text/x-pod',
);
1;
} or do{ $self->publisher->debug( $@ ); next; };
view all matches for this distribution
view release on metacpan or search on metacpan
t/stream_status.t view on Meta::CPAN
if ($type == 4 && !($flags & 1)) {
send_frame($peer, 4, 1, 0, ''); # SETTINGS ACK
} elsif ($type == 6 && !($flags & 1)) {
send_frame($peer, 6, 1, 0, $payload); # PING ACK
} elsif ($type == 1) {
# HPACK: indexed :status=200, literal content-type=application/grpc,
# then literal grpc-status and grpc-message; no Huffman coding.
(my $text = $message) =~ s/\{n\}/++$requests/e;
my $headers = "\x88\x0f\x10\x10application/grpc";
for my $field (['grpc-status', $status], ['grpc-message', $text]) {
$headers .= pack('CC', 0, length $field->[0]) . $field->[0]
view all matches for this distribution
view release on metacpan or search on metacpan
eg/produce_headers.pl view on Meta::CPAN
$kafka->connect(sub {
$kafka->produce('test-topic', 'event-key', '{"action":"click","page":"/home"}',
{
headers => {
'content-type' => 'application/json',
'trace-id' => 'abc-123-def',
'source' => 'web-frontend',
},
},
sub {
view all matches for this distribution
view release on metacpan or search on metacpan
eg/intercept.pl view on Meta::CPAN
}
# 2. MOCK: answer locally, without the network seeing anything.
if ($req->{url} =~ m{/robots\.txt$}) {
return { status => 200,
headers => { 'content-type' => 'text/plain' },
body => "User-agent: *\nDisallow: /\n" };
}
# 3. REWRITE: change the request that does go out. Anything set here
# overrides curl-impersonate's own template header of the same name.
view all matches for this distribution
view release on metacpan or search on metacpan
eg/multipart.pl view on Meta::CPAN
while (my $conn = $listener->accept) {
my $request = read_request($conn) or next;
my $body = '';
my ($boundary) = ($request->{headers}{'content-type'} // '') =~ /boundary=(\S+)/;
if ($boundary) {
for my $part (split /--\Q$boundary\E/, $request->{body}) {
my ($head, $data) = split /\r\n\r\n/, $part, 2;
next unless defined $data && $head =~ /name="([^"]+)"/;
my $name = $1;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/EVDB/API.pm view on Meta::CPAN
push @{$args}, $k, $self->{$k};
}
}
# If one of the arguments is a file, set up the Common-friendly
# file indicator field and set the content-type.
my $content_type = '';
foreach my $this_field (keys %{$arg_present})
{
# Any argument with a name that ends in "_file" is a file.
if ($this_field =~ /_file$/)
view all matches for this distribution
view release on metacpan or search on metacpan
www/edgeexpress/jscript/SpryAssets/SpryData.js view on Meta::CPAN
}
else if (!resp)
{
// The server said it sent us data, but for some reason we don't have
// an XML DOM document. Some browsers won't auto-create an XML DOM
// unless the server used a content-type of "text/xml" or "application/xml".
// Try to manually parse the XML string, just in case the server
// gave us an unexpected Content-Type.
manualParseRequired = true;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/EB/Shell/DeLuxe.pm view on Meta::CPAN
warn("?"._T("Vervolgregel ontbreekt in de invoer.")."\n") if $pre;
return;
}
if ( $line =~ /^\# \s*
content-type: \s*
text (?: \s* \/ \s* plain)? \s* ; \s*
charset \s* = \s* (\S+) \s* $/ix ) {
my $charset = lc($1);
if ( $charset =~ /^(?:utf-?8)$/i ) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Email/ARF/Report.pm view on Meta::CPAN
use warnings;
package Email::ARF::Report 0.012;
# ABSTRACT: interpret Abuse Reporting Format (ARF) messages
use Carp ();
use Email::MIME 1.929 (); # content-type attributes
use Email::MIME::ContentType 1.016 (); # type/subtype
use Scalar::Util ();
use Params::Util qw(_INSTANCE);
#pod =begin :prelude
view all matches for this distribution
view release on metacpan or search on metacpan
t/multipart.msg view on Meta::CPAN
Tue, 30 Jul 2013 05:55:51 -0700 (PDT)
Received: from smtp.pobox.com (unknown [127.0.0.1]) by
b-sasl-quonix.pobox.com (Postfix) with ESMTP id 5656333B7B for
<rjbs@cpan.org>; Tue, 30 Jul 2013 12:55:50 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from
:content-type:subject:message-id:date:to:mime-version; s=sasl;
bh=8y5A5fJ5PreQxsLHjgB27fxj+Og=; b=hOKuPVvtMKC87qv6ziDC3DNULjHh
RP0aLBHXUYxJ2YNksTe11d6pJmj/dB1XRR60c/8C48siLnQrBMwX+BjH+aFSi6bE
ZYkZtWxqPZBcSdfVlArkR5UMgh3ERSnlWx/YpeWtMsmqJ3r1rO1hoC44n9rM/VHx
+cW2KqR+tgB3ouk=
Received: from b-pb-sasl-quonix.pobox.com (unknown [127.0.0.1]) by
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Email/Abuse/Investigator.pm view on Meta::CPAN
map { $_->{value} }
grep { $_->{name} eq 'received' } @headers
];
# Determine content type and transfer encoding from top-level headers
my ($ct_h) = grep { $_->{name} eq 'content-type' } @headers;
my ($cte_h) = grep { $_->{name} eq 'content-transfer-encoding' } @headers;
my $ct = defined $ct_h ? $ct_h->{value} : '';
my $cte = defined $cte_h ? $cte_h->{value} : '';
# Decode multipart or single-part body as appropriate
lib/Email/Abuse/Investigator.pm view on Meta::CPAN
my %phdr;
for my $line (split /\r?\n/, $phdr_block) {
$phdr{ lc($1) } = $2 if $line =~ /^([\w-]+)\s*:\s*(.*)/;
}
my $pct = $phdr{'content-type'} // '';
my $pcte = $phdr{'content-transfer-encoding'} // '';
# Nested multipart/* must be recursed into; without this URLs in
# multipart/alternative inside multipart/mixed would be missed.
if ($pct =~ /multipart/i) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Email/Assets/File.pm view on Meta::CPAN
Object accessor method, returns full filename and path (which may not exist if the asset was created from data instead of a file).
=head2 mime_type
Object accessor method, returns MIME type / content-type of the asset
=head2 BUILD
moose method called by constructor, handles validating path to file
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Email/Blaster/MailSender.pm view on Meta::CPAN
To => $to,
From => '"' . $args{transmission}->from_name . '" <' . $args{transmission}->from_address . '>',
'reply-to' => $args{transmission}->reply_to,
Subject => $args{subject},
Message => encode_base64( $args{content} ),
'content-type' => $args{transmission}->content_type,
'content-transfer-encoding' => 'base64',
);
my ($queued_as) = $Mail::Sendmail::log =~ m/\s+queued as\s+(.*)/;
return $queued_as;
view all matches for this distribution
view release on metacpan or search on metacpan
t/sample_mail.txt view on Meta::CPAN
dmarc=pass (p=NONE dis=NONE) header.from=gmail.com
Received: by mail-pd0-x22e.google.com with SMTP id y13so162130pdi.19
for <hirobanex@gmail.com>; Mon, 18 Nov 2013 01:35:14 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=subject:from:content-type:message-id:date:to
:content-transfer-encoding:mime-version;
bh=v0LuvceDL6/cXu8rW4gasYfzT9chQzmx4uDpwJS7fc8=;
b=reW9/hH+wcQ9+cTr0BKVJ0q9bMxjSeDFvk6hieiTEsJN+wgfj4ofHLrb7Ibv/hCctA
B3SDGh+YZ3myWPDmV1SniAsgCo8hPMKvY1C9OsRQ8IDeGfHIsqRIdl16sq2uN/FeMpfi
QBKx6KI9iPHyHC+RGRBOLm9U2nCaj4w8Bm2xH6IdrAh4rDkpmBMFgU7BHszVu7sVAfBj
view all matches for this distribution
view release on metacpan or search on metacpan
1.314 2007-10-02
bug fix: bump up prereq on Email::MIME::Modifier
(fixes a scalar deref issue, reported by JESSE)
1.313 2006-11-25
resolve bug 19988, make content-type check for inline text case-insens
packaging improvements
1.311 2006-08-01
no code changes
update Makefile.PL to be more mine-able
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Email/MIME/ContentType.pm view on Meta::CPAN
#pod Content-Disposition header. Non-ASCII or too long attributes are handled in
#pod the same way like in L<build_content_type function|/build_content_type>.
#pod
#pod =head1 WARNINGS
#pod
#pod This is not a valid content-type header, according to both RFC 1521 and RFC
#pod 2045:
#pod
#pod Content-Type: type/subtype;
#pod
#pod If a semicolon appears, a parameter must. C<parse_content_type> will carp if
lib/Email/MIME/ContentType.pm view on Meta::CPAN
Content-Disposition header. Non-ASCII or too long attributes are handled in
the same way like in L<build_content_type function|/build_content_type>.
=head1 WARNINGS
This is not a valid content-type header, according to both RFC 1521 and RFC
2045:
Content-Type: type/subtype;
If a semicolon appears, a parameter must. C<parse_content_type> will carp if
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Email/MIME/CreateHTML.pm view on Meta::CPAN
A scalar value holding the HTML message body.
=item body_attributes =E<gt> I<hash reference>
This is passed as the attributes parameter to the C<create> method (supplied by C<Email::MIME::Creator>) that creates the html part of the mail.
The body content-type will be set to C<text/html> unless it is overidden here.
=item embed =E<gt> I<boolean>
Attach relative images and other media to the message. This is enabled by default.
The module will attempt to embed objects defined by C<embed_elements>.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Email/MIME/MobileJP/Parser.pm view on Meta::CPAN
}
}
sub get_parts {
my ($self, $content_type) = @_;
Carp::croak("missing content-type") unless defined $content_type;
my @parts;
$self->mail->walk_parts(sub {
my $part = shift;
return if $part->parts > 1; # multipart
view all matches for this distribution
view release on metacpan or search on metacpan
- fixed bug when Content-Type is not specified; and default to text/plain
(and do not base64-encode body text)
0.38 Mon Jul 4 19:22:27 CEST 2005
- fixed bug in _XMLbodyEncode() to make content-type checking
case insensistive
- added POD patches as reported by Mike Castel <dalgoda@ix.netcom.com>
0.37 Tue May 24 01:42:29 CEST 2005
view all matches for this distribution
view release on metacpan or search on metacpan
1.949 2020-05-24 10:25:36-04:00 America/New_York
- no changes since trial release
1.948 2020-05-09 14:57:17-04:00 America/New_York (TRIAL RELEASE)
- fixes to handling of content-type parameters (thanks, dlucredativ and
Pali Rohár)
1.947 2020-05-09 14:30:06-04:00 America/New_York (TRIAL RELEASE)
- add $Email::MIME::MAX_DEPTH and refuse to parse deeper than that many
parts; current default: 10
1.934 2015-08-01 20:33:57-04:00 America/New_York
- fix debug_structure for multipart mail with only one subpart
1.933 2015-07-25 09:30:56-04:00 America/New_York
- correct Email::Simple prereq
- skip omitting content-type attributes with undef value
1.932 2015-07-24 22:24:06-04:00 America/New_York
- stable release of previous trial releases
- see v1.930 and v1.931, below
1.930 2015-03-25 22:58:42-04:00 America/New_York (TRIAL RELEASE)
- rely on the new header_raw methods in new Email::Simple
1.929 2015-02-17 09:31:35-05:00 America/New_York
- try not to lose unrecognized content-type parameters
- avoid copying the body content when not needed during construction
1.928 2014-12-15 21:47:49-05:00 America/New_York
- when converting from single part to multipart, drop
Content-Transfer-Encoding and Content-Type's charset property
view all matches for this distribution
view release on metacpan or search on metacpan
t/full_structure.t view on Meta::CPAN
my $m = shift;
my @names = sort grep(!/^content-id$/, map {lc $_} $m->header_names);
my @arr = map {
my @h = map { $_ =~ s/\s\s*/ /sg; $_ } sort $m->header($_);
@h = map { sanitize_content_type($_) } @h if lc $_ eq 'content-type';
@h = map { sanitize_content_disposition($_) } @h if lc $_ eq 'content-disposition';
$_ . ": " . join "\n", @h;
} @names;
return \@arr;
}
view all matches for this distribution
view release on metacpan or search on metacpan
]);
is($complex->parts, 2, "one reply part, one original part");
like(
($complex->parts)[1]->header('content-type'),
qr{^message/rfc822},
'the second part is the original, rfc822-style',
);
like $complex->header('from'), qr/human\@earth\.sol/, "correct from";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Email/Send/Netease.pm view on Meta::CPAN
Type => 'text/html',
Data => $html_body,
Encoding => 'base64',
) or croak "create container failed: $!";
$msg->attr('content-type.charset' => 'UTF-8');
$msg->send( 'smtp',
$smtpsvr,
AuthUser=>$user,
AuthPass=>$self->{passwd},
Debug=>$self->{debug}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Email/Send/YYClouds.pm view on Meta::CPAN
Subject => encode( 'MIME-Header', $subject ),
Data => encode_utf8($body),
Encoding => 'quoted-printable',
) or die "create container failed: $!";
$msg->attr('content-type.charset' => 'UTF-8');
$msg->send( 'smtp',
$smtprelay,
Debug => $self->{debug}
);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Email/Send/Zoho.pm view on Meta::CPAN
Type => 'text/html',
Data => $html_body,
Encoding => 'base64',
) or croak "create container failed: $!";
$msg->attr('content-type.charset' => 'UTF-8');
$msg->send('smtp',
'smtp.zoho.com',
Port => 465,
AuthUser => $from_address,
AuthPass => $self->{passwd},
view all matches for this distribution
view release on metacpan or search on metacpan
my $request = { headers => {} };
# https://github.com/chansen/p5-http-tiny/blob/ce7583b7ea85abf69282f89746248c3a5e1e961a/lib/HTTP/Tiny.pm#L815
if ( defined $args->{content} ) {
if (ref $args->{content} eq 'CODE') {
$request->{headers}{'content-type'} ||= "application/octet-stream";
$request->{headers}{'transfer-encoding'} = 'chunked'
unless $request->{headers}{'content-length'}
|| $request->{headers}{'transfer-encoding'};
$request->{cb} = $args->{content};
}
my $content = $args->{content};
if ( $] ge '5.008' ) {
utf8::downgrade($content, 1)
or die(qq/Wide character in request message body\n/);
}
$request->{headers}{'content-type'} ||= "application/octet-stream";
$request->{headers}{'content-length'} = length $content
unless $request->{headers}{'content-length'}
|| $request->{headers}{'transfer-encoding'};
$request->{cb} = sub { substr $content, 0, length $content, '' };
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/success.t view on Meta::CPAN
is($result->id, $id, 'Return id correct');
my $req = shift @requests;
is($req->{method}, 'POST', 'POST method');
is($req->{uri}, "$proto://api:$api_key\@$host/$domain/messages.mime", 'URI ok');
like($req->{data}->{headers}->{'content-type'}, qr{^multipart/form-data},
'Used multipart/form-data');
sub body {
return (@_ > 1) ? [ map { body($_) } @_ ] : { body => $_[0] };
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/preserve-linefeed.t view on Meta::CPAN
use_ok( 'Email::Simple' );
my $original = <<'EOM';
subject:
=?utf-8?B?ZGVsLmljaW8udXMvbmV0d29yay9qb2VlIC0gW2Zyb20gbWlqaXRdIEJMQiBFY2MgMw==?=
content-type: text/plain
empty body
EOM
my $mail = Email::Simple->new( $original );
view all matches for this distribution