view release on metacpan or search on metacpan
t/fuguvm/proxy.t view on Meta::CPAN
'http://cdn.openbsd.org/pub/OpenBSD/distfiles/'),
'a directory listing with a trailing solidus is not' );
is( $on->distfile_limit, 4096, 'the cap is on the object' );
}
# A kernel has no extension, so the generic content-type table cannot
# name it. The policy adds that entry.
{
my $cache = App::FuguVM::Proxy::Cache->new( tempdir( CLEANUP => 1 ) );
is( $cache->content_type('/pub/OpenBSD/7.8/arm64/bsd'),
view all matches for this distribution
view release on metacpan or search on metacpan
share/static/jquery-1.4.2.js view on Meta::CPAN
// Opera returns 0 when status is 304
return xhr.status === 304 || xhr.status === 0;
},
httpData: function( xhr, type, s ) {
var ct = xhr.getResponseHeader("content-type") || "",
xml = type === "xml" || !type && ct.indexOf("xml") >= 0,
data = xml ? xhr.responseXML : xhr.responseText;
if ( xml && data.documentElement.nodeName === "parsererror" ) {
jQuery.error( "parsererror" );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/MFILE/WWW/Resource.pm view on Meta::CPAN
return 1 if $self->request->method eq 'GET';
# some requests may not specify a Content-Type at all
return 0 if not defined $content_type;
# unfortunately, Web::Machine sometimes sends the content-type
# as a plain string, and other times as an
# HTTP::Headers::ActionPack::MediaType object
if ( ref( $content_type ) eq '' ) {
return ( $content_type =~ m/application\/json/ ) ? 1 : 0;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Mimosa/Controller/JSON.pm view on Meta::CPAN
__PACKAGE__->config(
default => 'application/json',
stash_key => 'rest',
'map' => {
# Work around an ExtJS bug that sends the wrong content-type
'text/html' => 'JSON',
}
);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/MonM/Util.pm view on Meta::CPAN
Getting specified Bit
=item B<header_field_normalize>
print header_field_normalize("content-type"); # Content-Type
Returns normalized header field
=item B<merge>
view all matches for this distribution
view release on metacpan or search on metacpan
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
<link rel="stylesheet" type="text/css" media="screen, projection" href="style.css" />
<link rel="stylesheet" type="text/css" media="print" href="print.css" />
and `includes/footer' may contain
view all matches for this distribution
view release on metacpan or search on metacpan
public/javascripts/ace/mode-curly.js view on Meta::CPAN
"main": {},
"map": {"name": 1},
"mark": {},
"math": {},
"menu": {"type": 1, "label": 1},
"meta": {"http-equiv": {"content-type": 1}, "name": {"description": 1, "keywords": 1}, "content": {"text/html; charset=UTF-8": 1}, "charset": 1},
"meter": {"value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1},
"nav": {},
"noscript": {"href": 1},
"object": {"param": 1, "data": 1, "type": 1, "height" : 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1},
"ol": {"start": 1, "reversed": 1},
view all matches for this distribution
view release on metacpan or search on metacpan
t/conformance/hap-http.t view on Meta::CPAN
Protocol::HAP::Pairing::kTLVType_Method(), pack( 'C', 0 ),
);
my ( undef, $headers, undef ) =
dispatch( $hap, 'POST', '/pair-setup', $m1,
$hap->session_open );
is( $headers->{'content-type'},
'application/pairing+tlv8',
'pairing endpoints use application/pairing+tlv8' );
( undef, $headers, undef ) = dispatch( $hap, 'GET', '/accessories' );
is( $headers->{'content-type'},
'application/hap+json',
'accessory endpoints use application/hap+json' );
};
subtest '[HAP-HTTP §3] POST /identify paired vs unpaired' => sub {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/OpenMbox/Client.pm view on Meta::CPAN
Data => $body,
Path => $path,
Encoding => 'base64',
) or die "create container failed: $!";
$msg->attr('content-type.charset' => 'UTF-8');
$msg->send( 'smtp',
$host,
Port => $port,
AuthUser => $user,
AuthPass => $pass,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/PAIA/Agent.pm view on Meta::CPAN
success => q{},
status => $opts{status} // '599',
reason => 'Internal Exception',
content => $opts{msg},
headers => {
'content-type' => 'text/plain',
'content-length' => length $opts{msg},
}
};
}
view all matches for this distribution
view release on metacpan or search on metacpan
bin/pft-make view on Meta::CPAN
L<pft-init(1)>). The template is expected to define the encoding in a proper
way, that is by making use of the C<[% site.encoding %]> key in the HTML
header:
<head>
<meta http-equiv="content-type"
content="text/html; charset=[% site.encoding %]">
...
</head>
The result of a build is a collection of HTML pages. Since C<a href> links
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Phoebe.pm view on Meta::CPAN
} elsif (not -f $meta) {
result($stream, "40", "Metadata not found");
return;
}
my %meta = (map { split(/: /, $_, 2) } split /\n/, read_text $meta);
if (not $meta{'content-type'}) {
result($stream, "59", "Metadata corrupt");
return;
}
success($stream, $meta{'content-type'});
$stream->write(read_binary($file));
}
sub bogus_hash {
my $str = shift;
lib/App/Phoebe.pm view on Meta::CPAN
if ($@) {
result($stream, "59", "Unable to save $id");
return;
}
mkdir "$dir/meta" unless -d "$dir/meta";
eval { write_text($meta, "content-type: $type\n") };
if ($@) {
result($stream, "59", "Unable to save metadata for $id");
return;
}
$log->info("Wrote $id");
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Photobear.pm view on Meta::CPAN
Carp::croak("[url_type] ", sprintf("Child exited with value %d\n", $? >> 8));
}
my @output = `$cmd`;
for my $line (@output) {
chomp $line;
if ($line =~ /^content-type/i) {
# Strip color codes
$line =~ s/\e\[[\d;]*[a-zA-Z]//g;
my ($type) = $line =~ /Content-Type: (.*)/i;
return $type;
}
view all matches for this distribution
view release on metacpan or search on metacpan
configuration/configuration_template/frame.html view on Meta::CPAN
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Plog</title>
<link rel="stylesheet" href="sco.css" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<body>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Presto/Client.pm view on Meta::CPAN
}
sub GET {
my $self = shift;
my $uri = $self->_make_uri(@_);
my $existing_content_type = $self->clear_header('content-type'); # GET shouldn't have a content type
my $response = $self->_rest_client->GET($uri);
$self->set_header('content-type', $existing_content_type) if $existing_content_type;
return $response;
}
sub HEAD {
my $self = shift;
my $uri = $self->_make_uri(@_);
my $existing_content_type = $self->clear_header('content-type'); # HEAD shouldn't have a content type
my $response = $self->_rest_client->HEAD($uri);
$self->set_header('content-type', $existing_content_type) if $existing_content_type;
return $response;
}
sub DELETE {
my $self = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
SKIP:
{
my $res = {
'success' => q{},
'headers' => {
'content-type' => 'text/plain',
'content-length' => 76,
},
'content' => "Could not connect to 'no.such.url:80': node name or service name not known\n",
'url' => 'http://no.such.url./cpanfile',
'reason' => 'Internal Exception',
'x-timer' => 'S1528402525.672062,VS0,VE96',
'content-security-policy' => 'default-src \'none\'; style-src \'unsafe-inline\'; sandbox',
'x-cache' => 'MISS',
'x-fastly-request-id' => 'a46d6b434a76506ced7a5caf7ef0ff54e70b6569',
'via' => '1.1 varnish',
'content-type' => 'text/plain; charset=utf-8',
'x-cache-hits' => '0',
'etag' => '"b82620b2b61a7275fc1d0ad1bc9a405a00dba9c1"',
'x-content-type-options' => 'nosniff',
},
};
my $module = Test::MockModule->new('HTTP::Tiny');
$module->redefine( 'get', sub { return $res; } );
view all matches for this distribution
view release on metacpan or search on metacpan
socialcalc/third-party/hippie/jquery-1.3.2.min.js view on Meta::CPAN
* Sizzle CSS Selector Engine - v0.9.3
* Copyright 2009, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
* More information: http://sizzlejs.com/
*/
(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==...
view all matches for this distribution
view release on metacpan or search on metacpan
Change: e333a6e40d30eaf1f1b59640adf5d13971b83d94
Author: Alceu Rodrigues de Freitas Junior <glasswalk3r@yahoo.com.br>
Date : 2022-03-20 11:47:03 +0000
feat: split charset from content-type
Change: 03ebc1c728569c71e1504957557795c1fe77667d
Author: Alceu Rodrigues de Freitas Junior <glasswalk3r@yahoo.com.br>
Date : 2022-03-20 11:43:04 +0000
view all matches for this distribution
view release on metacpan or search on metacpan
examples/html/myapp.html view on Meta::CPAN
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:" />
</head>
<body>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/TemplateServer.pm view on Meta::CPAN
sub _success {
my $content = shift;
my $headers = HTTP::Headers->new;
# set up utf8
$headers->header('content-type' => 'text/html; charset=utf8');
utf8::upgrade($content); # kill latin1
utf8::encode($content);
return HTTP::Response->new(200, 'OK', $headers, $content);
}
view all matches for this distribution
view release on metacpan or search on metacpan
examples/complex/input/jquery.min.js view on Meta::CPAN
/*! jQuery v1.8.3 jquery.com | jquery.org/license */
(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r=...
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Wax.pm view on Meta::CPAN
$self->debug('removing: %s', $filename);
unlink($filename) || $self->log(WARN => "Can't unlink %s: %s", $filename, $!);
}
}
# return the URL's content-type or an empty string if the request fails
method content_type ($_url) {
my ($url, $url_index) = @$_url;
my $response = $self->_lwp_user_agent->head($url);
my $content_type = '';
if ($response->is_success) {
# the initial (pre-semicolon) part of the mime-type, trimmed and lowercased.
$content_type = $response->headers->content_type;
if ($content_type) {
$self->debug('content-type (%d): %s', $url_index, $content_type);
} else {
$content_type = DEFAULT_CONTENT_TYPE;
$self->debug('content-type (%d): %s (default)', $url_index, $content_type);
}
}
return $content_type;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Zapzi/Fetchers/File.pm view on Meta::CPAN
Name of transformer visible to user.
=head2 handles($content_type)
Returns a valid filename if this module handles the given content-type
=head2 fetch
Downloads an article
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/ZofCMS/Plugin/SendFile.pm view on Meta::CPAN
plugins => [ qw/SendFile/ ],
plug_send_file => [
'../zcms_site/config.txt', # filename to send; this one is outside the webdir
'attachment', # optional to set content-disposition to attachment
'text/plain', # optional to set content-type instead of guessing one
'LOL.txt', # optional to set filename instead of using same as original
],
In your HTML::Template template:
lib/App/ZofCMS/Plugin/SendFile.pm view on Meta::CPAN
plug_send_file => 'foo.txt', # file to send
plug_send_file => [
'../zcms_site/config.txt', # filename to send; this one is outside the webdir
'attachment', # optional to set content-disposition to attachment
'text/plain', # optional to set content-type instead of guessing one
'LOL.txt', # optional to set filename instead of using same as original
],
plug_send_file => sub {
my ( $t, $q, $conf ) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/bsky.pm view on Meta::CPAN
my ( $content, $headers ) = $bsky->at->http->get($avatar);
use Carp;
$content // confess 'failed to download avatar from ' . $avatar;
# TODO: check content type HTTP::Tiny and Mojo::UserAgent do this differently
$avatar = $bsky->uploadFile( $content, $headers->{'content-type'} );
}
elsif ( -e $avatar ) {
use Path::Tiny;
$avatar = path($avatar)->slurp_raw;
my $type = substr( $avatar, 0, 2 ) eq pack 'H*',
lib/App/bsky.pm view on Meta::CPAN
my ( $content, $headers ) = $bsky->at->http->get($banner);
use Carp;
$content // confess 'failed to download banner from ' . $banner;
# TODO: check content type HTTP::Tiny and Mojo::UserAgent do this differently
$banner = $bsky->uploadFile( $content, $headers->{'content-type'} );
}
elsif ( -e $banner ) {
use Path::Tiny;
$banner = path($banner)->slurp_raw;
my $type = substr( $banner, 0, 2 ) eq pack 'H*',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/cloudconvert.pm view on Meta::CPAN
if ($response->code == '303') {
$response = $ua->mirror( $response->header('location'), $outputfile );
} else {
my $error = "conversion failed";
if (!$response->is_success) {
if ($response->header('content-type') eq 'application/json') {
my $content = from_json($response->decoded_content);
$error = $content->{error};
}
}
say STDERR $response->code, ": ", $error;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/cpanminus/fatscript.pm view on Meta::CPAN
#pod
#pod $response = $http->post_form($url, $form_data);
#pod $response = $http->post_form($url, $form_data, \%options);
#pod
#pod This method executes a C<POST> request and sends the key/value pairs from a
#pod form data hash or array reference to the given URL with a C<content-type> of
#pod C<application/x-www-form-urlencoded>. If data is provided as an array
#pod reference, the order is preserved; if provided as a hash reference, the terms
#pod are sorted on key and value for consistency. See documentation for the
#pod C<www_form_urlencode> method for details on the encoding.
#pod
#pod The URL must have unsafe characters escaped and international domain names
#pod encoded. See C<request()> for valid options and a description of the response.
#pod Any C<content-type> header or content in the options hashref will be ignored.
#pod
#pod The C<success> field of the response will be true if the status code is 2XX.
#pod
#pod =cut
lib/App/cpanminus/fatscript.pm view on Meta::CPAN
return $self->request('POST', $url, {
%$args,
content => $self->www_form_urlencode($data),
headers => {
%$headers,
'content-type' => 'application/x-www-form-urlencoded'
},
}
);
}
lib/App/cpanminus/fatscript.pm view on Meta::CPAN
#pod
#pod If the C<content> option is a code reference, it will be called iteratively
#pod to provide the content body of the request. It should return the empty
#pod string or undef when the iterator is exhausted.
#pod
#pod If the C<content> option is the empty string, no C<content-type> or
#pod C<content-length> headers will be generated.
#pod
#pod If the C<data_callback> option is provided, it will be called iteratively until
#pod the entire response body is received. The first argument will be a string
#pod containing a chunk of the response body, the second argument will be the
lib/App/cpanminus/fatscript.pm view on Meta::CPAN
success => q{},
status => 599,
reason => 'Internal Exception',
content => $e,
headers => {
'content-type' => 'text/plain',
'content-length' => length $e,
}
};
}
return $response;
lib/App/cpanminus/fatscript.pm view on Meta::CPAN
$request->{headers}{'connection'} = "close"
unless $self->{keep_alive};
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};
}
lib/App/cpanminus/fatscript.pm view on Meta::CPAN
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, '' };
}
lib/App/cpanminus/fatscript.pm view on Meta::CPAN
$response = $http->post_form($url, $form_data);
$response = $http->post_form($url, $form_data, \%options);
This method executes a C<POST> request and sends the key/value pairs from a
form data hash or array reference to the given URL with a C<content-type> of
C<application/x-www-form-urlencoded>. If data is provided as an array
reference, the order is preserved; if provided as a hash reference, the terms
are sorted on key and value for consistency. See documentation for the
C<www_form_urlencode> method for details on the encoding.
The URL must have unsafe characters escaped and international domain names
encoded. See C<request()> for valid options and a description of the response.
Any C<content-type> header or content in the options hashref will be ignored.
The C<success> field of the response will be true if the status code is 2XX.
=head2 mirror
lib/App/cpanminus/fatscript.pm view on Meta::CPAN
If the C<content> option is a code reference, it will be called iteratively
to provide the content body of the request. It should return the empty
string or undef when the iterator is exhausted.
If the C<content> option is the empty string, no C<content-type> or
C<content-length> headers will be generated.
If the C<data_callback> option is provided, it will be called iteratively until
the entire response body is received. The first argument will be a string
containing a chunk of the response body, the second argument will be the
view all matches for this distribution
view release on metacpan or search on metacpan
success => q{},
status => 599,
reason => 'Internal Exception',
content => $e,
headers => {
'content-type' => 'text/plain',
'content-length' => length $e,
}
};
}
return $response;
$request->{headers}{'host'} = $request->{host_port};
$request->{headers}{'connection'} = "close";
$request->{headers}{'user-agent'} ||= $self->{agent};
if (defined $args->{content}) {
$request->{headers}{'content-type'} ||= "application/octet-stream";
if (ref $args->{content} eq 'CODE') {
$request->{headers}{'transfer-encoding'} = 'chunked'
unless $request->{headers}{'content-length'}
|| $request->{headers}{'transfer-encoding'};
$request->{cb} = $args->{content};
view all matches for this distribution
view release on metacpan or search on metacpan
script/cpanurl view on Meta::CPAN
return $self->request('POST', $url, {
%$args,
content => $self->www_form_urlencode($data),
headers => {
%$headers,
'content-type' => 'application/x-www-form-urlencoded'
},
}
);
}
script/cpanurl view on Meta::CPAN
success => q{},
status => 599,
reason => 'Internal Exception',
content => $e,
headers => {
'content-type' => 'text/plain',
'content-length' => length $e,
}
};
}
return $response;
script/cpanurl view on Meta::CPAN
$request->{headers}{'host'} = $request->{host_port};
$request->{headers}{'connection'} = "close";
$request->{headers}{'user-agent'} ||= $self->{agent};
if (defined $args->{content}) {
$request->{headers}{'content-type'} ||= "application/octet-stream";
if (ref $args->{content} eq 'CODE') {
$request->{headers}{'transfer-encoding'} = 'chunked'
unless $request->{headers}{'content-length'}
|| $request->{headers}{'transfer-encoding'};
$request->{cb} = $args->{content};
view all matches for this distribution