From 8dda66ee78df54d38d86c7e7ed0c8695fec78e40 Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Tue, 31 Jul 2018 23:49:38 -0400 Subject: add more debugging but also probably fix redirect problem --- Bugzilla/Quantum/CGI.pm | 2 +- Bugzilla/Quantum/Plugin/Hostage.pm | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'Bugzilla/Quantum') diff --git a/Bugzilla/Quantum/CGI.pm b/Bugzilla/Quantum/CGI.pm index 7585d888a..0a74f1ee5 100644 --- a/Bugzilla/Quantum/CGI.pm +++ b/Bugzilla/Quantum/CGI.pm @@ -117,7 +117,7 @@ sub _ENV { CONTENT_LENGTH => $content_length || 0, CONTENT_TYPE => $headers->content_type || '', GATEWAY_INTERFACE => 'CGI/1.1', - HTTPS => $req->is_secure ? 'YES' : 'NO', + HTTPS => $req->is_secure ? 'on' : 'off', %env_headers, QUERY_STRING => $cgi_query->to_string, PATH_INFO => $path_info ? "/$path_info" : '', diff --git a/Bugzilla/Quantum/Plugin/Hostage.pm b/Bugzilla/Quantum/Plugin/Hostage.pm index 19c77995e..cbde7b5ee 100644 --- a/Bugzilla/Quantum/Plugin/Hostage.pm +++ b/Bugzilla/Quantum/Plugin/Hostage.pm @@ -1,6 +1,7 @@ package Bugzilla::Quantum::Plugin::Hostage; use 5.10.1; use Mojo::Base 'Mojolicious::Plugin'; +use Bugzilla::Logging; sub _attachment_root { my ($base) = @_; @@ -50,6 +51,7 @@ sub _before_routes { return if $path eq '/__lbheartbeat__'; if ( $attachment_base && $hostname eq $attachment_root ) { + DEBUG("redirecting to $urlbase because $hostname is $attachment_root"); $c->redirect_to($urlbase); return; } @@ -61,6 +63,7 @@ sub _before_routes { my $new_uri = $url->clone; $new_uri->scheme( $urlbase_uri->scheme ); $new_uri->host($urlbase_host); + DEBUG("redirecting to $new_uri because $hostname matches attachment regex"); $c->redirect_to($new_uri); return; } @@ -69,10 +72,12 @@ sub _before_routes { my $new_uri = $urlbase_uri->clone; $new_uri->path('/show_bug.cgi'); $new_uri->query_form( id => $id ); + DEBUG("redirecting to $new_uri because $hostname includes bug id"); $c->redirect_to($new_uri); return; } else { + DEBUG("redirecting to $urlbase because $hostname doesn't make sense"); $c->redirect_to($urlbase); return; } -- cgit v1.2.3-24-g4f1b