NAME

HTTP::Promise::Headers::StrictTransportSecurity - Strict-Transport-Security Header Field

SYNOPSIS

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;

VERSION

v0.1.0

DESCRIPTION

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

METHODS

as_string

Returns a string representation of the Strict-Transport-Security object.

include_subdomains

Boolean, optional. If provided with a true value, the parameter includeSubDomains will be added.

If this optional parameter is enabled, this means that this rule applies to all of the site's subdomains as well.

max_age

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.

param

Set or get an arbitrary name-value pair attribute.

params

Set or get multiple name-value parameters.

Calling this without any parameters, retrieves the associated hash object

preload

Boolean, optional. If provided with a true value, the parameter preload will be added.

property

Sets or gets an arbitrary property.

$h->property( community => 'UCI' );
my $val = $h->property( 'community' );

See also rfc7234, section 5.2.3

property_boolean

Sets or gets an arbitrary boolean property.

$h->property_boolean( private_property => 1 );

properties

Returns the hash object used as a repository of properties.

AUTHOR

Jacques Deguest <jack@deguest.jp>

SEE ALSO

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 & LICENSE

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.