You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ngcp-panel/lib/NGCP/Panel/Middleware/HSTS.pm

15 lines
369 B

package NGCP::Panel::Middleware::HSTS;
use Sipwise::Base;
use Plack::Util qw();
extends 'Plack::Middleware';
sub call {
my ($self, $env) = @_;
my $res = $self->app->($env);
$self->response_cb($res, sub {
my $res = shift;
my $h = Plack::Util::headers($res->[1]);
$h->set('Strict-Transport-Security' => 'max-age=86400000');
});
}