HTTP::Promise::Headers::StrictTransportSecurity - Strict-Transport-Security Header Field
use HTTP::Promise::Headers::StrictTransportSecurity; my $sts = HTTP::Promise::Headers::StrictTransportSecurity->new || die( HTTP::Promise::Headers::StrictTransportSecurity->error, "\n" ); $sts->include_subdomains(1); $sts->max_age(63072000); $sts->preload(1); say "$sts"; # same thing say $sts->as_string;
v0.1.0
The following is an extract from Mozilla documentation.
The HTTP Strict-Transport-Security response header (often abbreviated as HSTS) informs browsers that the site should only be accessed using HTTPS, and that any future attempts to access it using HTTP should automatically be converted to HTTPS.
Example:
Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
Returns a string representation of the Strict-Transport-Security object.
Strict-Transport-Security
Boolean, optional. If provided with a true value, the parameter includeSubDomains will be added.
includeSubDomains
If this optional parameter is enabled, this means that this rule applies to all of the site's subdomains as well.
Integer, required value (but not enforced).
The time, in seconds, that the browser should remember that a site is only to be accessed using HTTPS.
Set or get an arbitrary name-value pair attribute.
Set or get multiple name-value parameters.
Calling this without any parameters, retrieves the associated hash object
Boolean, optional. If provided with a true value, the parameter preload will be added.
preload
Sets or gets an arbitrary property.
$h->property( community => 'UCI' ); my $val = $h->property( 'community' );
See also rfc7234, section 5.2.3
Sets or gets an arbitrary boolean property.
$h->property_boolean( private_property => 1 );
Returns the hash object used as a repository of properties.
Jacques Deguest <jack@deguest.jp>
See also rfc6797, section 6.1 and Mozilla documentation
HTTP::Promise, HTTP::Promise::Request, HTTP::Promise::Response, HTTP::Promise::Message, HTTP::Promise::Entity, HTTP::Promise::Headers, HTTP::Promise::Body, HTTP::Promise::Body::Form, HTTP::Promise::Body::Form::Data, HTTP::Promise::Body::Form::Field, HTTP::Promise::Status, HTTP::Promise::MIME, HTTP::Promise::Parser, HTTP::Promise::IO, HTTP::Promise::Stream, HTTP::Promise::Exception
Copyright(c) 2022 DEGUEST Pte. Ltd.
All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install HTTP::Promise, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTTP::Promise
CPAN shell
perl -MCPAN -e shell install HTTP::Promise
For more information on module installation, please visit the detailed CPAN module installation guide.