fix for undef HTTP_SERVER and HTTP_PORT err when browsing swagger-ui

This commit is contained in:
Oliver Gorwits
2023-06-12 14:41:26 +01:00
parent bb9be51acc
commit 5181d83742

View File

@@ -363,7 +363,8 @@ hook before_layout_render => sub {
hook 'after' => sub { hook 'after' => sub {
my $r = shift; # a Dancer::Response 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) { and ref {} eq ref $r->content) {
my $spec = dclone $r->content; my $spec = dclone $r->content;