]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1516021 - Rename all references in the code and file tree from Quantum to App
authordklawren <dklawren@users.noreply.github.com>
Wed, 26 Dec 2018 20:45:44 +0000 (15:45 -0500)
committerDylan William Hardison <dylan@hardison.net>
Wed, 26 Dec 2018 20:45:44 +0000 (15:45 -0500)
24 files changed:
Bugzilla.pm
Bugzilla/App.pm [moved from Bugzilla/Quantum.pm with 83% similarity]
Bugzilla/App/API.pm [moved from Bugzilla/Quantum/API.pm with 97% similarity]
Bugzilla/App/CGI.pm [moved from Bugzilla/Quantum/CGI.pm with 97% similarity]
Bugzilla/App/Command/revoke_api_keys.pm [moved from Bugzilla/Quantum/Command/revoke_api_keys.pm with 85% similarity]
Bugzilla/App/Home.pm [moved from Bugzilla/Quantum/Home.pm with 95% similarity]
Bugzilla/App/OAuth2/Clients.pm [moved from Bugzilla/Quantum/OAuth2/Clients.pm with 99% similarity]
Bugzilla/App/Plugin/BlockIP.pm [moved from Bugzilla/Quantum/Plugin/BlockIP.pm with 96% similarity]
Bugzilla/App/Plugin/Glue.pm [moved from Bugzilla/Quantum/Plugin/Glue.pm with 99% similarity]
Bugzilla/App/Plugin/Helpers.pm [moved from Bugzilla/Quantum/Plugin/Helpers.pm with 97% similarity]
Bugzilla/App/Plugin/Hostage.pm [moved from Bugzilla/Quantum/Plugin/Hostage.pm with 98% similarity]
Bugzilla/App/Plugin/OAuth2.pm [moved from Bugzilla/Quantum/Plugin/OAuth2.pm with 99% similarity]
Bugzilla/App/Plugin/SizeLimit.pm [moved from Bugzilla/Quantum/Plugin/SizeLimit.pm with 98% similarity]
Bugzilla/App/SES.pm [moved from Bugzilla/Quantum/SES.pm with 99% similarity]
Bugzilla/App/Static.pm [moved from Bugzilla/Quantum/Static.pm with 95% similarity]
Bugzilla/App/Stdout.pm [moved from Bugzilla/Quantum/Stdout.pm with 97% similarity]
Bugzilla/CGI.pm
Bugzilla/Error.pm
Bugzilla/Util.pm
bugzilla.pl
scripts/block-ip.pl
t/mojo-example.t
t/mojo-oauth2.t
xmlrpc.cgi

index d120a9bf47ce93a2a16781cd25ce70eac9e16573..8ffc95971a15ec1c68c51081a2b78a6025a5e840 100644 (file)
@@ -395,7 +395,7 @@ sub login {
   }
 
   # If Mojo native app is requesting login, we need to possibly redirect
-  my $C = $Bugzilla::Quantum::CGI::C;
+  my $C = $Bugzilla::App::CGI::C;
   if ($C->session->{override_login_target}) {
     my $mojo_url = Mojo::URL->new($C->session->{override_login_target});
     $mojo_url->query($C->session->{cgi_params});
@@ -788,7 +788,7 @@ sub check_rate_limit {
       Bugzilla->audit(
         "[rate_limit] action=$action, ip=$ip, limit=$limit, name=$name");
       if ($action eq 'block') {
-        $Bugzilla::Quantum::CGI::C->block_ip($ip);
+        $Bugzilla::App::CGI::C->block_ip($ip);
         ThrowUserError("rate_limit");
       }
     }
similarity index 83%
rename from Bugzilla/Quantum.pm
rename to Bugzilla/App.pm
index 670781fb16273fe2351ccba4c4d86ce259b5634c..1af429f2fda087f69d2fbdcd690fdd5ffeaa8bca 100644 (file)
@@ -5,7 +5,7 @@
 # This Source Code Form is "Incompatible With Secondary Licenses", as
 # defined by the Mozilla Public License, v. 2.0.
 
-package Bugzilla::Quantum;
+package Bugzilla::App;
 use Mojo::Base 'Mojolicious';
 
 # Needed for its exit() overload, must happen early in execution.
@@ -20,12 +20,12 @@ use Bugzilla::Constants qw(bz_locations);
 use Bugzilla::Extension             ();
 use Bugzilla::Install::Requirements ();
 use Bugzilla::Logging;
-use Bugzilla::Quantum::CGI;
-use Bugzilla::Quantum::OAuth2::Clients;
-use Bugzilla::Quantum::SES;
-use Bugzilla::Quantum::Home;
-use Bugzilla::Quantum::API;
-use Bugzilla::Quantum::Static;
+use Bugzilla::App::CGI;
+use Bugzilla::App::OAuth2::Clients;
+use Bugzilla::App::SES;
+use Bugzilla::App::Home;
+use Bugzilla::App::API;
+use Bugzilla::App::Static;
 use Mojo::Loader qw( find_modules );
 use Module::Runtime qw( require_module );
 use Bugzilla::Util ();
@@ -34,23 +34,23 @@ use MojoX::Log::Log4perl::Tiny;
 use Bugzilla::WebService::Server::REST;
 use Try::Tiny;
 
-has 'static' => sub { Bugzilla::Quantum::Static->new };
+has 'static' => sub { Bugzilla::App::Static->new };
 
 sub startup {
   my ($self) = @_;
 
   TRACE('Starting up');
-  $self->plugin('Bugzilla::Quantum::Plugin::BlockIP');
-  $self->plugin('Bugzilla::Quantum::Plugin::Glue');
-  $self->plugin('Bugzilla::Quantum::Plugin::Hostage')
+  $self->plugin('Bugzilla::App::Plugin::BlockIP');
+  $self->plugin('Bugzilla::App::Plugin::Glue');
+  $self->plugin('Bugzilla::App::Plugin::Hostage')
     unless $ENV{BUGZILLA_DISABLE_HOSTAGE};
-  $self->plugin('Bugzilla::Quantum::Plugin::SizeLimit')
+  $self->plugin('Bugzilla::App::Plugin::SizeLimit')
     unless $ENV{BUGZILLA_DISABLE_SIZELIMIT};
   $self->plugin('ForwardedFor') if Bugzilla->has_feature('better_xff');
-  $self->plugin('Bugzilla::Quantum::Plugin::Helpers');
-  $self->plugin('Bugzilla::Quantum::Plugin::OAuth2');
+  $self->plugin('Bugzilla::App::Plugin::Helpers');
+  $self->plugin('Bugzilla::App::Plugin::OAuth2');
 
-  push @{ $self->commands->namespaces }, 'Bugzilla::Quantum::Command';
+  push @{ $self->commands->namespaces }, 'Bugzilla::App::Command';
 
   $self->hook(
     before_routes => sub {
@@ -127,8 +127,8 @@ sub setup_routes {
   my ($self) = @_;
 
   my $r = $self->routes;
-  Bugzilla::Quantum::CGI->setup_routes($r);
-  Bugzilla::Quantum::CGI->load_one('bzapi_cgi', 'extensions/BzAPI/bin/rest.cgi');
+  Bugzilla::App::CGI->setup_routes($r);
+  Bugzilla::App::CGI->load_one('bzapi_cgi', 'extensions/BzAPI/bin/rest.cgi');
 
   $r->get('/home')->to('Home#index');
   $r->any('/')->to('CGI#index_cgi');
@@ -163,9 +163,9 @@ sub setup_routes {
   $r->any('/login')->to('CGI#index_cgi' => {'GoAheadAndLogIn' => '1'});
   $r->any('/:new_bug' => [new_bug => qr{new[-_]bug}])->to('CGI#new_bug_cgi');
 
-  Bugzilla::Quantum::API->setup_routes($r);
-  Bugzilla::Quantum::SES->setup_routes($r);
-  Bugzilla::Quantum::OAuth2::Clients->setup_routes($r);
+  Bugzilla::App::API->setup_routes($r);
+  Bugzilla::App::SES->setup_routes($r);
+  Bugzilla::App::OAuth2::Clients->setup_routes($r);
 }
 
 1;
similarity index 97%
rename from Bugzilla/Quantum/API.pm
rename to Bugzilla/App/API.pm
index 82e49754aba124a5eb119414e6d4c339df1f01e7..3d34eba154a7f09862246aeebccadfb0a988b668 100644 (file)
@@ -5,7 +5,7 @@
 # This Source Code Form is "Incompatible With Secondary Licenses", as
 # defined by the Mozilla Public License, v. 2.0.
 
-package Bugzilla::Quantum::API;
+package Bugzilla::App::API;
 use 5.10.1;
 use Mojo::Base qw( Mojolicious::Controller );
 use Mojo::JSON qw( true false );
similarity index 97%
rename from Bugzilla/Quantum/CGI.pm
rename to Bugzilla/App/CGI.pm
index e14bc7f64c4f57065e9a2ee04402d610f683871a..911b2ea06ac8b1e0c820688e6b465a51ed80475e 100644 (file)
@@ -5,7 +5,7 @@
 # This Source Code Form is "Incompatible With Secondary Licenses", as
 # defined by the Mozilla Public License, v. 2.0.
 
-package Bugzilla::Quantum::CGI;
+package Bugzilla::App::CGI;
 use Mojo::Base 'Mojolicious::Controller';
 
 use CGI::Compile;
@@ -17,7 +17,7 @@ use Sub::Name;
 use Socket qw(AF_INET inet_aton);
 use Mojo::File qw(path);
 use English qw(-no_match_vars);
-use Bugzilla::Quantum::Stdout;
+use Bugzilla::App::Stdout;
 use Bugzilla::Constants qw(bz_locations USAGE_MODE_BROWSER);
 
 our $C;
@@ -53,7 +53,7 @@ sub load_one {
     open STDIN, '<', $stdin->path
       or die "STDIN @{[$stdin->path]}: $!"
       if -s $stdin->path;
-    tie *STDOUT, 'Bugzilla::Quantum::Stdout', controller => $c;   ## no critic (tie)
+    tie *STDOUT, 'Bugzilla::App::Stdout', controller => $c;   ## no critic (tie)
 
     # the finally block calls cleanup.
     $c->stash->{cleanup_guard}->dismiss;
similarity index 85%
rename from Bugzilla/Quantum/Command/revoke_api_keys.pm
rename to Bugzilla/App/Command/revoke_api_keys.pm
index 304a88b8161597d7cba9bf888f5f748f459b558e..39666640f3a57d4e83a68f83555eac0101475fef 100644 (file)
@@ -5,7 +5,7 @@
 # This Source Code Form is "Incompatible With Secondary Licenses", as
 # defined by the Mozilla Public License, v. 2.0.
 
-package Bugzilla::Quantum::Command::revoke_api_keys; ## no critic (Capitalization)
+package Bugzilla::App::Command::revoke_api_keys; ## no critic (Capitalization)
 use 5.10.1;
 use Mojo::Base 'Mojolicious::Command';
 
@@ -46,7 +46,7 @@ __END__
 
 =head1 NAME
 
-Bugzilla::Quantum::Command::revoke_api_keys - revoke API keys command
+Bugzilla::App::Command::revoke_api_keys - revoke API keys command
 
 =head1 SYNOPSIS
 
@@ -61,11 +61,11 @@ Bugzilla::Quantum::Command::revoke_api_keys - revoke API keys command
 
 =head1 DESCRIPTION
 
-L<Bugzilla::Quantum::Command::revoke_api_keys> revokes API keys.
+L<Bugzilla::App::Command::revoke_api_keys> revokes API keys.
 
 =head1 ATTRIBUTES
 
-L<Bugzilla::Quantum::Command::revoke_api_keys> inherits all attributes from
+L<Bugzilla::App::Command::revoke_api_keys> inherits all attributes from
 L<Mojolicious::Command> and implements the following new ones.
 
 =head2 description
@@ -84,7 +84,7 @@ Usage information for this command, used for the help screen.
 
 =head1 METHODS
 
-L<Bugzilla::Quantum::Command::revoke_api_keys> inherits all methods from
+L<Bugzilla::App::Command::revoke_api_keys> inherits all methods from
 L<Mojolicious::Command> and implements the following new ones.
 
 =head2 run
similarity index 95%
rename from Bugzilla/Quantum/Home.pm
rename to Bugzilla/App/Home.pm
index 6a3021f64342aa80047e10fb230bb2e53c876a91..bd21c45c00541b740a7bd6c9a54c15b4d5e46386 100644 (file)
@@ -5,7 +5,7 @@
 # This Source Code Form is "Incompatible With Secondary Licenses", as
 # defined by the Mozilla Public License, v. 2.0.
 
-package Bugzilla::Quantum::Home;
+package Bugzilla::App::Home;
 use Mojo::Base 'Mojolicious::Controller';
 
 use Bugzilla::Error;
similarity index 99%
rename from Bugzilla/Quantum/OAuth2/Clients.pm
rename to Bugzilla/App/OAuth2/Clients.pm
index 33431b1b0775ed1ef9858f3fb275da679eb96bea..083e73d22896a5a4f73bb5a21a6b487c6f8504fc 100644 (file)
@@ -5,7 +5,7 @@
 # This Source Code Form is "Incompatible With Secondary Licenses", as
 # defined by the Mozilla Public License, v. 2.0.
 
-package Bugzilla::Quantum::OAuth2::Clients;
+package Bugzilla::App::OAuth2::Clients;
 use 5.10.1;
 use Mojo::Base 'Mojolicious::Controller';
 
similarity index 96%
rename from Bugzilla/Quantum/Plugin/BlockIP.pm
rename to Bugzilla/App/Plugin/BlockIP.pm
index f97ce276a4be0c9e90fbadfdbe057f4a5a1440cc..675bc823c6e23fe0716e733445ae17b9a1b7cc17 100644 (file)
@@ -1,4 +1,4 @@
-package Bugzilla::Quantum::Plugin::BlockIP;
+package Bugzilla::App::Plugin::BlockIP;
 use 5.10.1;
 use Mojo::Base 'Mojolicious::Plugin';
 
similarity index 99%
rename from Bugzilla/Quantum/Plugin/Glue.pm
rename to Bugzilla/App/Plugin/Glue.pm
index de016356cc4a9b12192332f38963c9bce4073da8..be7d4456523f376c5a2077775b18ca23e1313e2d 100644 (file)
@@ -5,7 +5,7 @@
 # This Source Code Form is "Incompatible With Secondary Licenses", as
 # defined by the Mozilla Public License, v. 2.0.
 
-package Bugzilla::Quantum::Plugin::Glue;
+package Bugzilla::App::Plugin::Glue;
 use 5.10.1;
 use Mojo::Base 'Mojolicious::Plugin';
 
similarity index 97%
rename from Bugzilla/Quantum/Plugin/Helpers.pm
rename to Bugzilla/App/Plugin/Helpers.pm
index 72dd96cf932bf2fbb60f2bcff2ee74474d28b028..872a39631a10f01fa893fc5a28914411f91940ca 100644 (file)
@@ -4,7 +4,7 @@
 #
 # This Source Code Form is "Incompatible With Secondary Licenses", as
 # defined by the Mozilla Public License, v. 2.0.
-package Bugzilla::Quantum::Plugin::Helpers;
+package Bugzilla::App::Plugin::Helpers;
 use 5.10.1;
 use Mojo::Base qw(Mojolicious::Plugin);
 
similarity index 98%
rename from Bugzilla/Quantum/Plugin/Hostage.pm
rename to Bugzilla/App/Plugin/Hostage.pm
index 0cf42124c31cfa901e8afe7416e3ae2c2090b09a..62ce7d01d8cd735ababa0caf5d40f890562735a6 100644 (file)
@@ -1,4 +1,4 @@
-package Bugzilla::Quantum::Plugin::Hostage;
+package Bugzilla::App::Plugin::Hostage;
 use 5.10.1;
 use Mojo::Base 'Mojolicious::Plugin';
 use Bugzilla::Logging;
similarity index 99%
rename from Bugzilla/Quantum/Plugin/OAuth2.pm
rename to Bugzilla/App/Plugin/OAuth2.pm
index d2f10501379400fb158dfea9d7e0a5c3ec764bff..a3365dbacbdceb217aa57c71600e4947b025957c 100644 (file)
@@ -5,7 +5,7 @@
 # This Source Code Form is "Incompatible With Secondary Licenses", as
 # defined by the Mozilla Public License, v. 2.0.
 
-package Bugzilla::Quantum::Plugin::OAuth2;
+package Bugzilla::App::Plugin::OAuth2;
 use 5.10.1;
 use Mojo::Base 'Mojolicious::Plugin::OAuth2::Server';
 
similarity index 98%
rename from Bugzilla/Quantum/Plugin/SizeLimit.pm
rename to Bugzilla/App/Plugin/SizeLimit.pm
index 2f436fe65cb30f4a421ef819427e35f33eae9d8c..7fdc8cbc4f26e9c955fc8353cd2bb49ccdef6744 100644 (file)
@@ -5,7 +5,7 @@
 # This Source Code Form is "Incompatible With Secondary Licenses", as
 # defined by the Mozilla Public License, v. 2.0.
 
-package Bugzilla::Quantum::Plugin::SizeLimit;
+package Bugzilla::App::Plugin::SizeLimit;
 use 5.10.1;
 use Mojo::Base 'Mojolicious::Plugin';
 use Mojo::JSON qw(decode_json);
similarity index 99%
rename from Bugzilla/Quantum/SES.pm
rename to Bugzilla/App/SES.pm
index cac173b350928d12b3bd219b5d17542cd5b874b1..037d64534cbf42299860f10c14b00bd727bd06bd 100644 (file)
@@ -1,4 +1,4 @@
-package Bugzilla::Quantum::SES;
+package Bugzilla::App::SES;
 
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
similarity index 95%
rename from Bugzilla/Quantum/Static.pm
rename to Bugzilla/App/Static.pm
index 6ac803e96c3729399bf088127a9ab2be60257ab8..ada937273acb83bc63609e563ab6fd099251f4df 100644 (file)
@@ -5,7 +5,7 @@
 # This Source Code Form is "Incompatible With Secondary Licenses", as
 # defined by the Mozilla Public License, v. 2.0.
 
-package Bugzilla::Quantum::Static;
+package Bugzilla::App::Static;
 use Mojo::Base 'Mojolicious::Static';
 use Bugzilla::Constants qw(bz_locations);
 
similarity index 97%
rename from Bugzilla/Quantum/Stdout.pm
rename to Bugzilla/App/Stdout.pm
index 10be0b664f1ae0102cce0c96e1d4585998d4d451..481a6f15d35827d31006acec7637996dc0af48d1 100644 (file)
@@ -5,7 +5,7 @@
 # This Source Code Form is "Incompatible With Secondary Licenses", as
 # defined by the Mozilla Public License, v. 2.0.
 
-package Bugzilla::Quantum::Stdout;
+package Bugzilla::App::Stdout;
 use 5.10.1;
 use Moo;
 
index 24d687093afb7b33c499909884a63e1c450d9eca..3d7daed3e9066e6fa0f2f87c405aabdbcc612f05 100644 (file)
@@ -647,8 +647,8 @@ sub header {
     }
   }
   my $headers = $self->SUPER::header(%headers) || '';
-  if ($self->server_software eq 'Bugzilla::Quantum::CGI') {
-    my $c = $Bugzilla::Quantum::CGI::C;
+  if ($self->server_software eq 'Bugzilla::App::CGI') {
+    my $c = $Bugzilla::App::CGI::C;
     $c->res->headers->parse($headers);
     my $status = $c->res->headers->status;
     if ($status && $status =~ /^([0-9]+)/) {
@@ -664,7 +664,7 @@ sub header {
   }
   else {
     LOGDIE(
-      "Bugzilla::CGI->header() should only be called from inside Bugzilla::Quantum::CGI!"
+      "Bugzilla::CGI->header() should only be called from inside Bugzilla::App::CGI!"
     );
   }
 }
index 4a6ab6865891b63f4655196772e13e31bdbb9b02..00c11b5884a37dd0bfbc4632725456acb3ec9824 100644 (file)
@@ -34,7 +34,7 @@ use Scalar::Util qw(blessed);
 sub _in_eval {
   my $in_eval = 0;
   for (my $stack = 1; my $sub = (caller($stack))[3]; $stack++) {
-    last if $sub =~ /^Bugzilla::Quantum::CGI::try/;
+    last if $sub =~ /^Bugzilla::App::CGI::try/;
     $in_eval = 1 if $sub =~ /^\(eval\)/;
   }
   return $in_eval;
index e0099203c994a7b1bd5e3feb69a7afc9ad165d16..252f918223c74ede7fb2ffc59ead70d1586e8143 100644 (file)
@@ -336,8 +336,8 @@ sub do_ssl_redirect_if_required {
 
 # Returns the real remote address of the client,
 sub remote_ip {
-  if (($ENV{SERVER_SOFTWARE} // '') eq 'Bugzilla::Quantum::CGI') {
-    my $c = $Bugzilla::Quantum::CGI::C or LOGDIE("Cannot find controller!");
+  if (($ENV{SERVER_SOFTWARE} // '') eq 'Bugzilla::App::CGI') {
+    my $c = $Bugzilla::App::CGI::C or LOGDIE("Cannot find controller!");
     state $better_xff = Bugzilla->has_feature('better_xff');
     return $better_xff ? $c->forwarded_for : $c->tx->remote_address;
   }
index 0f385d42fa7a775366aeee37a4c7ef49faccc935..34075d78949dc74ac311d84c73487178c7f7d7fe 100755 (executable)
@@ -17,4 +17,4 @@ use Mojolicious::Commands;
 $ENV{MOJO_LISTEN} ||= $ENV{PORT} ? "http://*:$ENV{PORT}" : "http://*:3001";
 
 # Start command line interface for application
-Mojolicious::Commands->start_app('Bugzilla::Quantum');
+Mojolicious::Commands->start_app('Bugzilla::App');
index bfbf88fd7a2dd0e97b4838c63cebe12c6293ce9f..c2b4b19299f0803a347f88b76a296c0e35d5b574 100755 (executable)
@@ -12,7 +12,7 @@ use warnings;
 use lib qw(. lib local/lib/perl5);
 
 use Bugzilla;
-use Bugzilla::Quantum;
+use Bugzilla::App;
 use Bugzilla::Constants;
 use Getopt::Long;
 
@@ -23,7 +23,7 @@ GetOptions('unblock' => \$unblock);
 
 pod2usage("No IPs given") unless @ARGV;
 
-my $app = Bugzilla::Quantum->new;
+my $app = Bugzilla::App->new;
 
 if ($unblock) {
   $app->unblock_ip($_) for @ARGV;
@@ -55,4 +55,4 @@ If passed, the IPs will be unblocked instead of blocked. Use this to remove IPs
 
 =head1 DESCRIPTION
 
-This is just a simple CLI inteface to L<Bugzilla::Quantum::Plugin::BlockIP>.
+This is just a simple CLI inteface to L<Bugzilla::App::Plugin::BlockIP>.
index 68c7d4d87aca772329f464cbd230f74d0d8bcdd1..e9ca7f56e14cfb2b397f81ad9b990221689f0d4e 100644 (file)
@@ -43,7 +43,7 @@ my $api_key = issue_api_key('api@mozilla.org')->api_key;
 
 # Mojo::Test loads the application and provides methods for
 # testing requests without having to run a server.
-my $t = Test::Mojo->new('Bugzilla::Quantum');
+my $t = Test::Mojo->new('Bugzilla::App');
 
 # we ensure this file exists so the /__lbhearbeat__ test passes.
 $t->app->home->child('__lbheartbeat__')->spurt('httpd OK');
index cafda8165014c82ce73ebce020f2a755a84500aa..b43ee8577c37974b371f92a6cc86579f0c9fcd05 100644 (file)
@@ -36,7 +36,7 @@ ok $oauth_client->{id}, 'New client id (' . $oauth_client->{id} . ')';
 ok $oauth_client->{secret},
   'New client secret (' . $oauth_client->{secret} . ')';
 
-my $t = Test::Mojo->new('Bugzilla::Quantum');
+my $t = Test::Mojo->new('Bugzilla::App');
 
 # Allow 1 redirect max
 $t->ua->max_redirects(1);
index 620187e5aa0370624ec276fe64e83b6a74dfc0c9..435237ed58f7fd36e2f112f926fd7cee41d566fb 100755 (executable)
@@ -45,7 +45,7 @@ my $stdout = capture_stdout {
 # for setting SOAPAction, which isn't used by XML-RPC.
   $server->on_action(sub { $server->handle_login(WS_DISPATCH, @_) })->handle();
 };
-my $C = $Bugzilla::Quantum::CGI::C;
+my $C = $Bugzilla::App::CGI::C;
 my ($header_str, $body) = split(/(?:\r\n\r\n|\n\n)/, $stdout, 2);
 my $headers = Mojo::Headers->new;
 $headers->parse("$header_str\r\n\r\n");