From 5181d8374289d279f7bbdac705c9a8bc01882669 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Mon, 12 Jun 2023 14:41:26 +0100 Subject: [PATCH] fix for undef HTTP_SERVER and HTTP_PORT err when browsing swagger-ui --- lib/App/Netdisco/Web.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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;