Hide some warnings (#1487)

This commit is contained in:
Xavier Guimard 2018-08-15 22:47:23 +02:00
parent 9b39f2e44c
commit 52348ecbb0
2 changed files with 13 additions and 8 deletions

View File

@ -307,8 +307,11 @@ sub _displayRegister {
[] ]; [] ];
} }
my $_2fDevices = eval { from_json( $req->userData->{_2fDevices}, my $_2fDevices =
{ allow_nonref => 1 } ); }; $req->userData->{_2fDevices}
? eval { from_json( $req->userData->{_2fDevices},
{ allow_nonref => 1 } ); }
: undef;
unless ($_2fDevices) { unless ($_2fDevices) {
$self->logger->debug("No 2F Device found"); $self->logger->debug("No 2F Device found");

View File

@ -725,16 +725,18 @@ sub sendHtml {
# Set authorized URL for POST # Set authorized URL for POST
my $csp = $self->csp . "form-action 'self'"; my $csp = $self->csp . "form-action 'self'";
if ( my $url = $req->urldc ) { if ( my $url = $req->urldc ) {
$self->logger->debug("Required urldc : $url"); $self->logger->debug("Required urldc : $url");
$url =~ s#(https?://[^/]+).*#$1#; $url =~ s#(https?://[^/]+).*#$1#;
$self->logger->debug("Set CSP form-action with urldc : $url"); $self->logger->debug("Set CSP form-action with urldc : $url");
$csp .= " $url"; $csp .= " $url";
} }
my $url = $args{params}->{URL}; my $url = $args{params}->{URL};
$self->logger->debug("Required Params URL : $url"); if ( defined $url ) {
if ( defined $url and $url =~ s#(https?://[^/]+).*#$1# ) { $self->logger->debug("Required Params URL : $url");
$self->logger->debug("Set CSP form-action with Params URL : $url"); if ( $url =~ s#(https?://[^/]+).*#$1# ) {
$csp .= " $url"; $self->logger->debug("Set CSP form-action with Params URL : $url");
$csp .= " $url";
}
} }
$csp .= ';'; $csp .= ';';