diff --git a/lib/App/Netdisco/Web.pm b/lib/App/Netdisco/Web.pm index 24788087..edbc0444 100644 --- a/lib/App/Netdisco/Web.pm +++ b/lib/App/Netdisco/Web.pm @@ -363,7 +363,8 @@ hook before_layout_render => sub { hook 'after' => sub { my $r = shift; # a Dancer::Response - if (request->path eq uri_for('/swagger.json')->path + if (request->path =~ m{/swagger\.json} and + request->path eq uri_for('/swagger.json')->path and ref {} eq ref $r->content) { my $spec = dclone $r->content;