TT#36055 Fix code 500 on unauthorized provisioning

Change-Id: I0fee5a6e2245ba2a7a2792abc33809242c8962bc
changes/64/21264/5
Irina Peshinskaya 8 years ago
parent 9b10bc58ae
commit 0cea7ca9b2

@ -1121,7 +1121,7 @@ sub dev_field_config :Chained('/') :PathPart('device/autoprov/config') :Args() {
($c->user_exists && ($c->user->roles eq "admin" || $c->user->roles eq "reseller")) ||
defined $c->request->env->{SSL_CLIENT_M_DN}
) {
$c->log->notice("unauthenticated config access to id '$id' via ip " . $c->req->address);
$c->log->info("unauthenticated config access to id '$id' via ip " . $c->req->address);
$c->response->content_type('text/plain');
if($c->config->{features}->{debug}) {
$c->response->body("403 - unauthenticated config access");
@ -1181,7 +1181,7 @@ sub dev_field_config :Chained('/') :PathPart('device/autoprov/config') :Args() {
$dn = lc($dn);
$dn =~ s/[:\-]//g;
if (index($dn, $id) == -1) {
$c->log->notice("unauthorized config access to id '$id' from dn '$dn' via ip '$ip'");
$c->log->info("unauthorized config access to id '$id' from dn '$dn' via ip '$ip'");
$c->response->content_type('text/plain');
if($c->config->{features}->{debug}) {
$c->response->body("403 - unauthorized config access");

Loading…
Cancel
Save