Imported Upstream version 6.56 upstream/6.56
authorDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 21 Jul 2022 02:28:27 +0000 (11:28 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 21 Jul 2022 02:28:27 +0000 (11:28 +0900)
33 files changed:
CONTRIBUTING.md
Changes
LICENSE
MANIFEST
META.json
META.yml
Makefile.PL
lib/LWP.pm
lib/LWP/Authen/Basic.pm
lib/LWP/Authen/Digest.pm
lib/LWP/Authen/Ntlm.pm
lib/LWP/ConnCache.pm
lib/LWP/Debug.pm
lib/LWP/Debug/TraceHTTP.pm
lib/LWP/DebugFile.pm
lib/LWP/MemberMixin.pm
lib/LWP/Protocol.pm
lib/LWP/Protocol/cpan.pm
lib/LWP/Protocol/data.pm
lib/LWP/Protocol/file.pm
lib/LWP/Protocol/ftp.pm
lib/LWP/Protocol/gopher.pm
lib/LWP/Protocol/http.pm
lib/LWP/Protocol/loopback.pm
lib/LWP/Protocol/mailto.pm
lib/LWP/Protocol/nntp.pm
lib/LWP/Protocol/nogo.pm
lib/LWP/RobotUA.pm
lib/LWP/Simple.pm
lib/LWP/UserAgent.pm
t/base/default_content_type.t
t/base/proxy.t
xt/release/changes_has_content.t

index f4c8a77b1434196527d2a642741dd20b8b36de3c..e7a275d7d082756c07a3ae56d40d675168b22be0 100644 (file)
@@ -59,10 +59,9 @@ instructions for doing that is available here:
 
 https://help.github.com/articles/creating-a-pull-request
 
-All pull requests for this distribution will be automatically tested on Linux
-by Travis at: https://travis-ci.com/libwww-perl/libwww-perl
-Results will be visible in the pull request on GitHub. Follow the appropriate
-links for details when tests fail.
+All pull requests for this distribution will be automatically tested on Linux,
+MacOS, and Windows by GitHub Workflows. Results will be visible in the pull
+request on GitHub. Follow the appropriate links for details when tests fail.
 
 If you have found a bug, but do not have an accompanying patch to fix it, you
 can submit an issue report here:
@@ -116,8 +115,8 @@ You can learn more about Dist::Zilla at http://dzil.org/
 
 This distribution maintains the generated `META.json` and either `Makefile.PL`
 or `Build.PL` in the repository. This allows two things:
-[Travis CI](https://travis-ci.org/) can build and test the distribution without
-requiring Dist::Zilla, and the distribution can be installed directly from
+GitHub Workflows can build and test the distribution without requiring
+Dist::Zilla, and the distribution can be installed directly from
 Github or a local git repository using `cpanm` for testing (again, not
 requiring Dist::Zilla).
 
diff --git a/Changes b/Changes
index e44023a989c280f1fcf8a036421800998c0d396e..89790ba71f81455f106e6d8e4134583b2a3e6d1a 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,11 @@
 Change history for libwww-perl
 
+6.56      2021-08-17 13:57:12Z
+    - Update the CONTRIBUTING doc to no longer reference TravisCI. (GH #384) (Slaven Rezić)
+    - Increase test coverage for env_proxy() (GH#383) (Slaven Rezić)
+    - When a truthy Content-Type is provided, override the default (GH#385)
+      (Matthew Horsfall (alh))
+
 6.55      2021-06-17 13:57:06Z
     - Attempt to avoid rare fails in redirect.t (GH#380) (Arne Johannessen)
 
diff --git a/LICENSE b/LICENSE
index 46c936f3e3182bbc7090d7da827dd642a6a5845c..6cd4925ef5d29a9808118e0b73b0593bc6d398c0 100644 (file)
--- a/LICENSE
+++ b/LICENSE
@@ -292,21 +292,21 @@ Definitions:
 
   - "Package" refers to the collection of files distributed by the Copyright
     Holder, and derivatives of that collection of files created through
-    textual modification. 
+    textual modification.
   - "Standard Version" refers to such a Package if it has not been modified,
     or has been modified in accordance with the wishes of the Copyright
-    Holder. 
+    Holder.
   - "Copyright Holder" is whoever is named in the copyright or copyrights for
-    the package. 
+    the package.
   - "You" is you, if you're thinking about copying or distributing this Package.
   - "Reasonable copying fee" is whatever you can justify on the basis of media
     cost, duplication charges, time of people involved, and so on. (You will
     not be required to justify it to the Copyright Holder, but only to the
-    computing community at large as a market that must bear the fee.) 
+    computing community at large as a market that must bear the fee.)
   - "Freely Available" means that no fee is charged for the item itself, though
     there may be fees involved in handling the item. It also means that
     recipients of the item may redistribute it under the same conditions they
-    received it. 
+    received it.
 
 1. You may make and give away verbatim copies of the source form of the
 Standard Version of this Package without restriction, provided that you
@@ -373,7 +373,7 @@ products derived from this software without specific prior written permission.
 
 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
 WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
-MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
 The End
 
index e91d16602fee9a986f9027b1c7d9c60bb548080a..c67938a784f04312ab81728c8f26e3e644e5caa1 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,4 +1,4 @@
-# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.020.
+# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.024.
 CONTRIBUTING.md
 Changes
 INSTALL
index d6053a5816a8d52883208ebc1af988001f7ad173..c9936854c84b10edfd5f6daf9fbd0c10325bd882 100644 (file)
--- a/META.json
+++ b/META.json
@@ -4,7 +4,7 @@
       "Gisle Aas <gisle@activestate.com>"
    ],
    "dynamic_config" : 1,
-   "generated_by" : "Dist::Zilla version 6.020, CPAN::Meta::Converter version 2.150010",
+   "generated_by" : "Dist::Zilla version 6.024, CPAN::Meta::Converter version 2.150010",
    "license" : [
       "perl_5"
    ],
    "provides" : {
       "LWP" : {
          "file" : "lib/LWP.pm",
-         "version" : "6.55"
+         "version" : "6.56"
       },
       "LWP::Authen::Basic" : {
          "file" : "lib/LWP/Authen/Basic.pm",
-         "version" : "6.55"
+         "version" : "6.56"
       },
       "LWP::Authen::Digest" : {
          "file" : "lib/LWP/Authen/Digest.pm",
-         "version" : "6.55"
+         "version" : "6.56"
       },
       "LWP::Authen::Ntlm" : {
          "file" : "lib/LWP/Authen/Ntlm.pm",
-         "version" : "6.55"
+         "version" : "6.56"
       },
       "LWP::ConnCache" : {
          "file" : "lib/LWP/ConnCache.pm",
-         "version" : "6.55"
+         "version" : "6.56"
       },
       "LWP::Debug" : {
          "file" : "lib/LWP/Debug.pm",
-         "version" : "6.55",
+         "version" : "6.56",
          "x_deprecated" : 1
       },
       "LWP::Debug::TraceHTTP" : {
          "file" : "lib/LWP/Debug/TraceHTTP.pm",
-         "version" : "6.55"
+         "version" : "6.56"
       },
       "LWP::DebugFile" : {
          "file" : "lib/LWP/DebugFile.pm",
-         "version" : "6.55"
+         "version" : "6.56"
       },
       "LWP::MemberMixin" : {
          "file" : "lib/LWP/MemberMixin.pm",
-         "version" : "6.55"
+         "version" : "6.56"
       },
       "LWP::Protocol" : {
          "file" : "lib/LWP/Protocol.pm",
-         "version" : "6.55"
+         "version" : "6.56"
       },
       "LWP::Protocol::cpan" : {
          "file" : "lib/LWP/Protocol/cpan.pm",
-         "version" : "6.55"
+         "version" : "6.56"
       },
       "LWP::Protocol::data" : {
          "file" : "lib/LWP/Protocol/data.pm",
-         "version" : "6.55"
+         "version" : "6.56"
       },
       "LWP::Protocol::file" : {
          "file" : "lib/LWP/Protocol/file.pm",
-         "version" : "6.55"
+         "version" : "6.56"
       },
       "LWP::Protocol::ftp" : {
          "file" : "lib/LWP/Protocol/ftp.pm",
-         "version" : "6.55"
+         "version" : "6.56"
       },
       "LWP::Protocol::gopher" : {
          "file" : "lib/LWP/Protocol/gopher.pm",
-         "version" : "6.55"
+         "version" : "6.56"
       },
       "LWP::Protocol::http" : {
          "file" : "lib/LWP/Protocol/http.pm",
-         "version" : "6.55"
+         "version" : "6.56"
       },
       "LWP::Protocol::loopback" : {
          "file" : "lib/LWP/Protocol/loopback.pm",
-         "version" : "6.55"
+         "version" : "6.56"
       },
       "LWP::Protocol::mailto" : {
          "file" : "lib/LWP/Protocol/mailto.pm",
-         "version" : "6.55"
+         "version" : "6.56"
       },
       "LWP::Protocol::nntp" : {
          "file" : "lib/LWP/Protocol/nntp.pm",
-         "version" : "6.55"
+         "version" : "6.56"
       },
       "LWP::Protocol::nogo" : {
          "file" : "lib/LWP/Protocol/nogo.pm",
-         "version" : "6.55"
+         "version" : "6.56"
       },
       "LWP::RobotUA" : {
          "file" : "lib/LWP/RobotUA.pm",
-         "version" : "6.55"
+         "version" : "6.56"
       },
       "LWP::Simple" : {
          "file" : "lib/LWP/Simple.pm",
-         "version" : "6.55"
+         "version" : "6.56"
       },
       "LWP::UserAgent" : {
          "file" : "lib/LWP/UserAgent.pm",
-         "version" : "6.55"
+         "version" : "6.56"
       }
    },
    "release_status" : "stable",
       "x_IRC" : "irc://irc.perl.org/#lwp",
       "x_MailingList" : "mailto:libwww@perl.org"
    },
-   "version" : "6.55",
+   "version" : "6.56",
    "x_Dist_Zilla" : {
       "perl" : {
          "version" : "5.030003"
                }
             },
             "name" : "Git::GatherDir",
-            "version" : "2.047"
+            "version" : "2.048"
          },
          {
             "class" : "Dist::Zilla::Plugin::MetaConfig",
             "name" : "MetaConfig",
-            "version" : "6.020"
+            "version" : "6.024"
          },
          {
             "class" : "Dist::Zilla::Plugin::MetaProvides::Package",
                      {
                         "class" : "Dist::Zilla::Plugin::FinderCode",
                         "name" : "MetaProvides::Package/AUTOVIV/:InstallModulesPM",
-                        "version" : "6.020"
+                        "version" : "6.024"
                      }
                   ],
                   "include_underscores" : 0
          {
             "class" : "Dist::Zilla::Plugin::MetaNoIndex",
             "name" : "MetaNoIndex",
-            "version" : "6.020"
+            "version" : "6.024"
          },
          {
             "class" : "Dist::Zilla::Plugin::MetaYAML",
             "name" : "MetaYAML",
-            "version" : "6.020"
+            "version" : "6.024"
          },
          {
             "class" : "Dist::Zilla::Plugin::MetaJSON",
             "name" : "MetaJSON",
-            "version" : "6.020"
+            "version" : "6.024"
          },
          {
             "class" : "Dist::Zilla::Plugin::MetaResources",
             "name" : "MetaResources",
-            "version" : "6.020"
+            "version" : "6.024"
          },
          {
             "class" : "Dist::Zilla::Plugin::Deprecated",
          {
             "class" : "Dist::Zilla::Plugin::Manifest",
             "name" : "Manifest",
-            "version" : "6.020"
+            "version" : "6.024"
          },
          {
             "class" : "Dist::Zilla::Plugin::License",
             "name" : "License",
-            "version" : "6.020"
+            "version" : "6.024"
          },
          {
             "class" : "Dist::Zilla::Plugin::InstallGuide",
          {
             "class" : "Dist::Zilla::Plugin::ExecDir",
             "name" : "ExecDir",
-            "version" : "6.020"
+            "version" : "6.024"
          },
          {
             "class" : "Dist::Zilla::Plugin::Prereqs::FromCPANfile",
             "config" : {
                "Dist::Zilla::Plugin::MakeMaker" : {
                   "make_path" : "make",
-                  "version" : "6.020"
+                  "version" : "6.024"
                },
                "Dist::Zilla::Role::TestRunner" : {
-                  "default_jobs" : "4",
-                  "version" : "6.020"
+                  "default_jobs" : "1",
+                  "version" : "6.024"
                }
             },
             "name" : "MakeMaker::Awesome",
          {
             "class" : "Dist::Zilla::Plugin::PodSyntaxTests",
             "name" : "PodSyntaxTests",
-            "version" : "6.020"
+            "version" : "6.024"
          },
          {
             "class" : "Dist::Zilla::Plugin::Test::Pod::Coverage::Configurable",
                }
             },
             "name" : "Git::Check",
-            "version" : "2.047"
+            "version" : "2.048"
          },
          {
             "class" : "Dist::Zilla::Plugin::CheckStrictVersion",
             "class" : "Dist::Zilla::Plugin::RunExtraTests",
             "config" : {
                "Dist::Zilla::Role::TestRunner" : {
-                  "default_jobs" : "4"
+                  "default_jobs" : "1"
                }
             },
             "name" : "RunExtraTests",
          {
             "class" : "Dist::Zilla::Plugin::TestRelease",
             "name" : "TestRelease",
-            "version" : "6.020"
+            "version" : "6.024"
          },
          {
             "class" : "Dist::Zilla::Plugin::UploadToCPAN",
             "name" : "UploadToCPAN",
-            "version" : "6.020"
+            "version" : "6.024"
          },
          {
             "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod",
                }
             },
             "name" : "@Git::VersionManager/pluginbundle version",
-            "version" : "6.020"
+            "version" : "6.024"
          },
          {
             "class" : "Dist::Zilla::Plugin::RewriteVersion::Transitional",
                }
             },
             "name" : "@Git::VersionManager/release snapshot",
-            "version" : "2.047"
+            "version" : "2.048"
          },
          {
             "class" : "Dist::Zilla::Plugin::Git::Tag",
                   "branch" : null,
                   "changelog" : "Changes",
                   "signed" : 0,
-                  "tag" : "v6.55",
+                  "tag" : "v6.56",
                   "tag_format" : "v%V",
                   "tag_message" : "v%V"
                },
                }
             },
             "name" : "@Git::VersionManager/Git::Tag",
-            "version" : "2.047"
+            "version" : "2.048"
          },
          {
             "class" : "Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional",
          {
             "class" : "Dist::Zilla::Plugin::NextRelease",
             "name" : "@Git::VersionManager/NextRelease",
-            "version" : "6.020"
+            "version" : "6.024"
          },
          {
             "class" : "Dist::Zilla::Plugin::Git::Commit",
                }
             },
             "name" : "@Git::VersionManager/post-release commit",
-            "version" : "2.047"
+            "version" : "2.048"
          },
          {
             "class" : "Dist::Zilla::Plugin::Git::Push",
                }
             },
             "name" : "Git::Push",
-            "version" : "2.047"
+            "version" : "2.048"
          },
          {
             "class" : "Dist::Zilla::Plugin::ConfirmRelease",
             "name" : "ConfirmRelease",
-            "version" : "6.020"
+            "version" : "6.024"
          },
          {
             "class" : "Dist::Zilla::Plugin::FinderCode",
             "name" : ":InstallModules",
-            "version" : "6.020"
+            "version" : "6.024"
          },
          {
             "class" : "Dist::Zilla::Plugin::FinderCode",
             "name" : ":IncModules",
-            "version" : "6.020"
+            "version" : "6.024"
          },
          {
             "class" : "Dist::Zilla::Plugin::FinderCode",
             "name" : ":TestFiles",
-            "version" : "6.020"
+            "version" : "6.024"
          },
          {
             "class" : "Dist::Zilla::Plugin::FinderCode",
             "name" : ":ExtraTestFiles",
-            "version" : "6.020"
+            "version" : "6.024"
          },
          {
             "class" : "Dist::Zilla::Plugin::FinderCode",
             "name" : ":ExecFiles",
-            "version" : "6.020"
+            "version" : "6.024"
          },
          {
             "class" : "Dist::Zilla::Plugin::FinderCode",
             "name" : ":PerlExecFiles",
-            "version" : "6.020"
+            "version" : "6.024"
          },
          {
             "class" : "Dist::Zilla::Plugin::FinderCode",
             "name" : ":ShareFiles",
-            "version" : "6.020"
+            "version" : "6.024"
          },
          {
             "class" : "Dist::Zilla::Plugin::FinderCode",
             "name" : ":MainModule",
-            "version" : "6.020"
+            "version" : "6.024"
          },
          {
             "class" : "Dist::Zilla::Plugin::FinderCode",
             "name" : ":AllFiles",
-            "version" : "6.020"
+            "version" : "6.024"
          },
          {
             "class" : "Dist::Zilla::Plugin::FinderCode",
             "name" : ":NoFiles",
-            "version" : "6.020"
+            "version" : "6.024"
          },
          {
             "class" : "Dist::Zilla::Plugin::FinderCode",
             "name" : "MetaProvides::Package/AUTOVIV/:InstallModulesPM",
-            "version" : "6.020"
+            "version" : "6.024"
          }
       ],
       "zilla" : {
          "config" : {
             "is_trial" : 0
          },
-         "version" : "6.020"
+         "version" : "6.024"
       }
    },
    "x_contributors" : [
       "Shoichi Kaji <skaji@cpan.org>",
       "simbabque <simbabque@cpan.org>",
       "Slaven Rezic <slaven@rezic.de>",
+      "Slaven Rezic <slaven.rezic@idealo.de>",
       "Spiros Denaxas <s.denaxas@gmail.com>",
       "Steffen Ullrich <Steffen_Ullrich@genua.de>",
       "Steve Hay <SteveHay@planit.com>",
index 99a2e72a4c8558010401f7ffd193860ffbcb3639..e5ce173a4e9c4183deaf9450ca09a6783bc98a4c 100644 (file)
--- a/META.yml
+++ b/META.yml
@@ -18,7 +18,7 @@ configure_requires:
   Getopt::Long: '0'
   Module::Metadata: '0'
 dynamic_config: 1
-generated_by: 'Dist::Zilla version 6.020, CPAN::Meta::Converter version 2.150010'
+generated_by: 'Dist::Zilla version 6.024, CPAN::Meta::Converter version 2.150010'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -31,74 +31,74 @@ no_index:
 provides:
   LWP:
     file: lib/LWP.pm
-    version: '6.55'
+    version: '6.56'
   LWP::Authen::Basic:
     file: lib/LWP/Authen/Basic.pm
-    version: '6.55'
+    version: '6.56'
   LWP::Authen::Digest:
     file: lib/LWP/Authen/Digest.pm
-    version: '6.55'
+    version: '6.56'
   LWP::Authen::Ntlm:
     file: lib/LWP/Authen/Ntlm.pm
-    version: '6.55'
+    version: '6.56'
   LWP::ConnCache:
     file: lib/LWP/ConnCache.pm
-    version: '6.55'
+    version: '6.56'
   LWP::Debug:
     file: lib/LWP/Debug.pm
-    version: '6.55'
+    version: '6.56'
     x_deprecated: 1
   LWP::Debug::TraceHTTP:
     file: lib/LWP/Debug/TraceHTTP.pm
-    version: '6.55'
+    version: '6.56'
   LWP::DebugFile:
     file: lib/LWP/DebugFile.pm
-    version: '6.55'
+    version: '6.56'
   LWP::MemberMixin:
     file: lib/LWP/MemberMixin.pm
-    version: '6.55'
+    version: '6.56'
   LWP::Protocol:
     file: lib/LWP/Protocol.pm
-    version: '6.55'
+    version: '6.56'
   LWP::Protocol::cpan:
     file: lib/LWP/Protocol/cpan.pm
-    version: '6.55'
+    version: '6.56'
   LWP::Protocol::data:
     file: lib/LWP/Protocol/data.pm
-    version: '6.55'
+    version: '6.56'
   LWP::Protocol::file:
     file: lib/LWP/Protocol/file.pm
-    version: '6.55'
+    version: '6.56'
   LWP::Protocol::ftp:
     file: lib/LWP/Protocol/ftp.pm
-    version: '6.55'
+    version: '6.56'
   LWP::Protocol::gopher:
     file: lib/LWP/Protocol/gopher.pm
-    version: '6.55'
+    version: '6.56'
   LWP::Protocol::http:
     file: lib/LWP/Protocol/http.pm
-    version: '6.55'
+    version: '6.56'
   LWP::Protocol::loopback:
     file: lib/LWP/Protocol/loopback.pm
-    version: '6.55'
+    version: '6.56'
   LWP::Protocol::mailto:
     file: lib/LWP/Protocol/mailto.pm
-    version: '6.55'
+    version: '6.56'
   LWP::Protocol::nntp:
     file: lib/LWP/Protocol/nntp.pm
-    version: '6.55'
+    version: '6.56'
   LWP::Protocol::nogo:
     file: lib/LWP/Protocol/nogo.pm
-    version: '6.55'
+    version: '6.56'
   LWP::RobotUA:
     file: lib/LWP/RobotUA.pm
-    version: '6.55'
+    version: '6.56'
   LWP::Simple:
     file: lib/LWP/Simple.pm
-    version: '6.55'
+    version: '6.56'
   LWP::UserAgent:
     file: lib/LWP/UserAgent.pm
-    version: '6.55'
+    version: '6.56'
 requires:
   Digest::MD5: '0'
   Encode: '2.12'
@@ -134,7 +134,7 @@ resources:
   bugtracker: https://github.com/libwww-perl/libwww-perl/issues
   homepage: https://github.com/libwww-perl/libwww-perl
   repository: https://github.com/libwww-perl/libwww-perl.git
-version: '6.55'
+version: '6.56'
 x_Dist_Zilla:
   perl:
     version: '5.030003'
@@ -156,11 +156,11 @@ x_Dist_Zilla:
         Dist::Zilla::Plugin::Git::GatherDir:
           include_untracked: 0
       name: Git::GatherDir
-      version: '2.047'
+      version: '2.048'
     -
       class: Dist::Zilla::Plugin::MetaConfig
       name: MetaConfig
-      version: '6.020'
+      version: '6.024'
     -
       class: Dist::Zilla::Plugin::MetaProvides::Package
       config:
@@ -169,7 +169,7 @@ x_Dist_Zilla:
             -
               class: Dist::Zilla::Plugin::FinderCode
               name: MetaProvides::Package/AUTOVIV/:InstallModulesPM
-              version: '6.020'
+              version: '6.024'
           include_underscores: 0
         Dist::Zilla::Role::MetaProvider::Provider:
           $Dist::Zilla::Role::MetaProvider::Provider::VERSION: '2.002004'
@@ -184,19 +184,19 @@ x_Dist_Zilla:
     -
       class: Dist::Zilla::Plugin::MetaNoIndex
       name: MetaNoIndex
-      version: '6.020'
+      version: '6.024'
     -
       class: Dist::Zilla::Plugin::MetaYAML
       name: MetaYAML
-      version: '6.020'
+      version: '6.024'
     -
       class: Dist::Zilla::Plugin::MetaJSON
       name: MetaJSON
-      version: '6.020'
+      version: '6.024'
     -
       class: Dist::Zilla::Plugin::MetaResources
       name: MetaResources
-      version: '6.020'
+      version: '6.024'
     -
       class: Dist::Zilla::Plugin::Deprecated
       config:
@@ -224,11 +224,11 @@ x_Dist_Zilla:
     -
       class: Dist::Zilla::Plugin::Manifest
       name: Manifest
-      version: '6.020'
+      version: '6.024'
     -
       class: Dist::Zilla::Plugin::License
       name: License
-      version: '6.020'
+      version: '6.024'
     -
       class: Dist::Zilla::Plugin::InstallGuide
       config:
@@ -240,7 +240,7 @@ x_Dist_Zilla:
     -
       class: Dist::Zilla::Plugin::ExecDir
       name: ExecDir
-      version: '6.020'
+      version: '6.024'
     -
       class: Dist::Zilla::Plugin::Prereqs::FromCPANfile
       name: Prereqs::FromCPANfile
@@ -258,10 +258,10 @@ x_Dist_Zilla:
       config:
         Dist::Zilla::Plugin::MakeMaker:
           make_path: make
-          version: '6.020'
+          version: '6.024'
         Dist::Zilla::Role::TestRunner:
-          default_jobs: '4'
-          version: '6.020'
+          default_jobs: '1'
+          version: '6.024'
       name: MakeMaker::Awesome
       version: '0.48'
     -
@@ -335,7 +335,7 @@ x_Dist_Zilla:
     -
       class: Dist::Zilla::Plugin::PodSyntaxTests
       name: PodSyntaxTests
-      version: '6.020'
+      version: '6.024'
     -
       class: Dist::Zilla::Plugin::Test::Pod::Coverage::Configurable
       name: Test::Pod::Coverage::Configurable
@@ -480,7 +480,7 @@ x_Dist_Zilla:
           git_version: 2.32.0
           repo_root: .
       name: Git::Check
-      version: '2.047'
+      version: '2.048'
     -
       class: Dist::Zilla::Plugin::CheckStrictVersion
       name: CheckStrictVersion
@@ -489,7 +489,7 @@ x_Dist_Zilla:
       class: Dist::Zilla::Plugin::RunExtraTests
       config:
         Dist::Zilla::Role::TestRunner:
-          default_jobs: '4'
+          default_jobs: '1'
       name: RunExtraTests
       version: '0.029'
     -
@@ -503,11 +503,11 @@ x_Dist_Zilla:
     -
       class: Dist::Zilla::Plugin::TestRelease
       name: TestRelease
-      version: '6.020'
+      version: '6.024'
     -
       class: Dist::Zilla::Plugin::UploadToCPAN
       name: UploadToCPAN
-      version: '6.020'
+      version: '6.024'
     -
       class: Dist::Zilla::Plugin::ReadmeAnyFromPod
       config:
@@ -532,7 +532,7 @@ x_Dist_Zilla:
           phase: develop
           type: recommends
       name: '@Git::VersionManager/pluginbundle version'
-      version: '6.020'
+      version: '6.024'
     -
       class: Dist::Zilla::Plugin::RewriteVersion::Transitional
       config:
@@ -580,7 +580,7 @@ x_Dist_Zilla:
         Dist::Zilla::Role::Git::StringFormatter:
           time_zone: local
       name: '@Git::VersionManager/release snapshot'
-      version: '2.047'
+      version: '2.048'
     -
       class: Dist::Zilla::Plugin::Git::Tag
       config:
@@ -588,7 +588,7 @@ x_Dist_Zilla:
           branch: ~
           changelog: Changes
           signed: 0
-          tag: v6.55
+          tag: v6.56
           tag_format: v%V
           tag_message: v%V
         Dist::Zilla::Role::Git::Repo:
@@ -597,7 +597,7 @@ x_Dist_Zilla:
         Dist::Zilla::Role::Git::StringFormatter:
           time_zone: local
       name: '@Git::VersionManager/Git::Tag'
-      version: '2.047'
+      version: '2.048'
     -
       class: Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional
       config:
@@ -613,7 +613,7 @@ x_Dist_Zilla:
     -
       class: Dist::Zilla::Plugin::NextRelease
       name: '@Git::VersionManager/NextRelease'
-      version: '6.020'
+      version: '6.024'
     -
       class: Dist::Zilla::Plugin::Git::Commit
       config:
@@ -635,7 +635,7 @@ x_Dist_Zilla:
         Dist::Zilla::Role::Git::StringFormatter:
           time_zone: local
       name: '@Git::VersionManager/post-release commit'
-      version: '2.047'
+      version: '2.048'
     -
       class: Dist::Zilla::Plugin::Git::Push
       config:
@@ -647,60 +647,60 @@ x_Dist_Zilla:
           git_version: 2.32.0
           repo_root: .
       name: Git::Push
-      version: '2.047'
+      version: '2.048'
     -
       class: Dist::Zilla::Plugin::ConfirmRelease
       name: ConfirmRelease
-      version: '6.020'
+      version: '6.024'
     -
       class: Dist::Zilla::Plugin::FinderCode
       name: ':InstallModules'
-      version: '6.020'
+      version: '6.024'
     -
       class: Dist::Zilla::Plugin::FinderCode
       name: ':IncModules'
-      version: '6.020'
+      version: '6.024'
     -
       class: Dist::Zilla::Plugin::FinderCode
       name: ':TestFiles'
-      version: '6.020'
+      version: '6.024'
     -
       class: Dist::Zilla::Plugin::FinderCode
       name: ':ExtraTestFiles'
-      version: '6.020'
+      version: '6.024'
     -
       class: Dist::Zilla::Plugin::FinderCode
       name: ':ExecFiles'
-      version: '6.020'
+      version: '6.024'
     -
       class: Dist::Zilla::Plugin::FinderCode
       name: ':PerlExecFiles'
-      version: '6.020'
+      version: '6.024'
     -
       class: Dist::Zilla::Plugin::FinderCode
       name: ':ShareFiles'
-      version: '6.020'
+      version: '6.024'
     -
       class: Dist::Zilla::Plugin::FinderCode
       name: ':MainModule'
-      version: '6.020'
+      version: '6.024'
     -
       class: Dist::Zilla::Plugin::FinderCode
       name: ':AllFiles'
-      version: '6.020'
+      version: '6.024'
     -
       class: Dist::Zilla::Plugin::FinderCode
       name: ':NoFiles'
-      version: '6.020'
+      version: '6.024'
     -
       class: Dist::Zilla::Plugin::FinderCode
       name: MetaProvides::Package/AUTOVIV/:InstallModulesPM
-      version: '6.020'
+      version: '6.024'
   zilla:
     class: Dist::Zilla::Dist::Builder
     config:
       is_trial: '0'
-    version: '6.020'
+    version: '6.024'
 x_contributors:
   - 'Adam Kennedy <adamk@cpan.org>'
   - 'Adam Sjogren <asjo@koldfront.dk>'
@@ -785,6 +785,7 @@ x_contributors:
   - 'Shoichi Kaji <skaji@cpan.org>'
   - 'simbabque <simbabque@cpan.org>'
   - 'Slaven Rezic <slaven@rezic.de>'
+  - 'Slaven Rezic <slaven.rezic@idealo.de>'
   - 'Spiros Denaxas <s.denaxas@gmail.com>'
   - 'Steffen Ullrich <Steffen_Ullrich@genua.de>'
   - 'Steve Hay <SteveHay@planit.com>'
index d6211d35f05a7fc8f2aefa5c9088b6650cf31ec1..1b6f4dbcc001cb3ec8bfabdf486a660fcbfaa341 100644 (file)
@@ -86,7 +86,7 @@ my %WriteMakefileArgs = (
     "Test::Needs" => 0,
     "Test::RequiresInternet" => 0
   },
-  "VERSION" => "6.55",
+  "VERSION" => "6.56",
   "test" => {
     "TESTS" => "t/*.t t/base/*.t t/base/protocols/*.t t/leak/*.t t/local/*.t t/robot/*.t"
   }
index c59e6bd04de02ba0aae8012e7bf2bc647a05150e..ad717d1f7ad67f3caa8bae1f7fc469dd6bca3508 100644 (file)
@@ -1,6 +1,6 @@
 package LWP;
 
-our $VERSION = '6.55';
+our $VERSION = '6.56';
 
 require LWP::UserAgent;  # this should load everything you need
 
index bc64af2d9c6b3a6085dd966fc81d2ba5cae6fa45..39862deb7f2368ef43e0e603602ae729f2c92682 100644 (file)
@@ -2,7 +2,7 @@ package LWP::Authen::Basic;
 
 use strict;
 
-our $VERSION = '6.55';
+our $VERSION = '6.56';
 
 require Encode;
 require MIME::Base64;
index a6a16fc0af275d2b0bd5aff8426bd83b43e7c840..5f55559b66f9b39d5c5fb8d952ba18b52ce6013f 100644 (file)
@@ -3,7 +3,7 @@ package LWP::Authen::Digest;
 use strict;
 use base 'LWP::Authen::Basic';
 
-our $VERSION = '6.55';
+our $VERSION = '6.56';
 
 require Digest::MD5;
 
index 05beb88533d5e28065e45e6667e9e31f6473f4d8..43227a9a9bd0a70103a683880b179f44656db612 100644 (file)
@@ -2,7 +2,7 @@ package LWP::Authen::Ntlm;
 
 use strict;
 
-our $VERSION = '6.55';
+our $VERSION = '6.56';
 
 use Authen::NTLM "1.02";
 use MIME::Base64 "2.12";
index 7d1386c9003263d3d887951ee6969610efb276df..9d6fee8eeaee764a5e10fc9f44a76bb831291d96 100644 (file)
@@ -2,7 +2,7 @@ package LWP::ConnCache;
 
 use strict;
 
-our $VERSION = '6.55';
+our $VERSION = '6.56';
 our $DEBUG;
 
 sub new {
index 3871a1766744ad69169fbd654d8c4cae4ea81583..b49fbcccb5cf4fa362500c708fb6102978677819 100644 (file)
@@ -1,6 +1,6 @@
 package LWP::Debug;    # legacy
 
-our $VERSION = '6.55';
+our $VERSION = '6.56';
 
 require Exporter;
 our @ISA       = qw(Exporter);
index 758068be8e574b9e48a98a999535a9d6f41a2791..1faa0884a7f83a6c5d2e1057d8ff65bde0ed61a7 100644 (file)
@@ -11,7 +11,7 @@ package LWP::Debug::TraceHTTP;
 use strict;
 use base 'LWP::Protocol::http';
 
-our $VERSION = '6.55';
+our $VERSION = '6.56';
 
 package # hide from PAUSE
     LWP::Debug::TraceHTTP::Socket;
index cd87fc0e52fc744b453445f24394906e56faf3f3..5660f9948f72d68ee46e1932b7f5fac62c7946b4 100644 (file)
@@ -1,6 +1,6 @@
 package LWP::DebugFile;
 
-our $VERSION = '6.55';
+our $VERSION = '6.56';
 
 # legacy stub
 
index a66159dda39a9b58eeffe20ce0a8405bed46c791..b0abff83a6bd835a12d0b71447699cca268b5373 100644 (file)
@@ -1,6 +1,6 @@
 package LWP::MemberMixin;
 
-our $VERSION = '6.55';
+our $VERSION = '6.56';
 
 sub _elem {
     my $self = shift;
index 0765c2bbe39ecbedc0106dfb7b740fac652018ea..8d537342afae75e693ff39f856678afd5b864b12 100644 (file)
@@ -2,7 +2,7 @@ package LWP::Protocol;
 
 use base 'LWP::MemberMixin';
 
-our $VERSION = '6.55';
+our $VERSION = '6.56';
 
 use strict;
 use Carp ();
index 0b9ee9a16fd0fedfebcaf791553e83d2b80b3510..a61c3c7ecdd3356c906d76bc1a025e8d43ef4870 100644 (file)
@@ -4,7 +4,7 @@ use strict;
 
 use base qw(LWP::Protocol);
 
-our $VERSION = '6.55';
+our $VERSION = '6.56';
 
 require URI;
 require HTTP::Status;
index 6d137c9978a5f82338837dcd76f48276ce3c567d..82b45b7dc2af60ec50bfc19a79e869d7b1d0ffa9 100644 (file)
@@ -4,7 +4,7 @@ package LWP::Protocol::data;
 
 use strict;
 
-our $VERSION = '6.55';
+our $VERSION = '6.56';
 
 require HTTP::Response;
 require HTTP::Status;
index af0d9295c9dc286ad4a8fd78df05b91dd1ef5ddc..16da400d68ef43bc311da51b8691ce336ed3c01a 100644 (file)
@@ -4,7 +4,7 @@ use base qw(LWP::Protocol);
 
 use strict;
 
-our $VERSION = '6.55';
+our $VERSION = '6.56';
 
 require LWP::MediaTypes;
 require HTTP::Request;
index 8a221641b60ee89d4321284c29db722e05bc3105..42c94c80185882939b32932f8296724906fd1fb7 100644 (file)
@@ -5,7 +5,7 @@ package LWP::Protocol::ftp;
 use base qw(LWP::Protocol);
 use strict;
 
-our $VERSION = '6.55';
+our $VERSION = '6.56';
 
 use Carp            ();
 use HTTP::Status    ();
index 508ec6249a95d306afd04bacee448e3a13f5e7d1..dd73b422602adbf8e95945e2c1f2b9fc2c630c0c 100644 (file)
@@ -9,7 +9,7 @@ package LWP::Protocol::gopher;
 
 use strict;
 
-our $VERSION = '6.55';
+our $VERSION = '6.56';
 
 require HTTP::Response;
 require HTTP::Status;
index 4e5371615ffc52a2cd81d0cb058c11a580cbcb6a..c9dc0ee65656e42fa672626f6f6ad06ccbca2bc8 100644 (file)
@@ -2,7 +2,7 @@ package LWP::Protocol::http;
 
 use strict;
 
-our $VERSION = '6.55';
+our $VERSION = '6.56';
 
 require HTTP::Response;
 require HTTP::Status;
index cb929cc64c61452689b4c2d6b456acc949f5cb73..dd2679c934c333eb57fcda0b02e10fada9d56504 100644 (file)
@@ -2,7 +2,7 @@ package LWP::Protocol::loopback;
 
 use strict;
 
-our $VERSION = '6.55';
+our $VERSION = '6.56';
 
 require HTTP::Response;
 
index e8c245450cf713314ebc33e57a5289bc3a82c57b..4a977e540dd643d9e488eac295828b2e8b500f51 100644 (file)
@@ -11,7 +11,7 @@ require HTTP::Status;
 use Carp;
 use strict;
 
-our $VERSION = '6.55';
+our $VERSION = '6.56';
 
 use base qw(LWP::Protocol);
 our $SENDMAIL;
index 4a790bd1ae9b6ae82bacfb68a7b928b77610c628..7a04786eb902a01079d3892d0634c4dcb5e82fa9 100644 (file)
@@ -4,7 +4,7 @@ package LWP::Protocol::nntp;
 
 use base qw(LWP::Protocol);
 
-our $VERSION = '6.55';
+our $VERSION = '6.56';
 
 require HTTP::Response;
 require HTTP::Status;
index f094591527d3a957675aaa65348084e0260f917b..94cfaf09f68e88e9a973b25d2a84442565aff430 100644 (file)
@@ -7,7 +7,7 @@ package LWP::Protocol::nogo;
 
 use strict;
 
-our $VERSION = '6.55';
+our $VERSION = '6.56';
 
 require HTTP::Response;
 require HTTP::Status;
index c1a2260e0f78d70b1049f5157c17f4d184292b4d..dd9341d37f4d9959773132deac841321c4055d99 100644 (file)
@@ -2,7 +2,7 @@ package LWP::RobotUA;
 
 use base qw(LWP::UserAgent);
 
-our $VERSION = '6.55';
+our $VERSION = '6.56';
 
 require WWW::RobotRules;
 require HTTP::Request;
index f54b83ded566157932fb9368ae8f04a2872178f4..40b0e2e9b2b9cbda5fcd6acfd68b3cba2b25a260 100644 (file)
@@ -2,7 +2,7 @@ package LWP::Simple;
 
 use strict;
 
-our $VERSION = '6.55';
+our $VERSION = '6.56';
 
 require Exporter;
 
index c1fef0408ed6ac5fb3020c3fca5da76973747370..42586bfbbeb2895d1feb819bcdf881d50662e8b6 100644 (file)
@@ -16,7 +16,7 @@ use LWP::Protocol ();
 use Scalar::Util qw(blessed);
 use Try::Tiny qw(try catch);
 
-our $VERSION = '6.55';
+our $VERSION = '6.56';
 
 sub new
 {
@@ -445,38 +445,41 @@ sub get {
     return $self->request( HTTP::Request::Common::GET( @parameters ), @suff );
 }
 
-sub _has_raw_content {
+sub _maybe_copy_default_content_type {
     my $self = shift;
-    shift; # drop url
+    my $req  = shift;
+
+    my $default_ct = $self->default_header('Content-Type');
+    return unless defined $default_ct;
+
+    # drop url
+    shift;
 
-    # taken from HTTP::Request::Common::request_type_with_data
+    # adapted from HTTP::Request::Common::request_type_with_data
     my $content;
     $content = shift if @_ and ref $_[0];
-    my($k, $v);
-    while (($k,$v) = splice(@_, 0, 2)) {
+
+    # We only care about the final value, really
+    my $ct;
+
+    my ($k, $v);
+    while (($k, $v) = splice(@_, 0, 2)) {
         if (lc($k) eq 'content') {
             $content = $v;
         }
+        elsif (lc($k) eq 'content-type') {
+            $ct = $v;
+        }
     }
 
-    # We were given Content => 'string' ...
-    if (defined $content && ! ref ($content)) {
-        return 1;
-    }
-
-    return;
-}
-
-sub _maybe_copy_default_content_type {
-    my ($self, $req, @parameters) = @_;
+    # Content-type provided and truthy? skip
+    return if $ct;
 
-    # If we have a default Content-Type and someone passes in a POST/PUT
-    # with Content => 'some-string-value', use that Content-Type instead
-    # of x-www-form-urlencoded
-    my $ct = $self->default_header('Content-Type');
-    return unless defined $ct && $self->_has_raw_content(@parameters);
+    # Content is not just a string? Then it must be x-www-form-urlencoded
+    return if defined $content && ref($content);
 
-    $req->header('Content-Type' => $ct);
+    # Provide default
+    $req->header('Content-Type' => $default_ct);
 }
 
 sub post {
index 0897ce70681eea871facadeb7f0c63ad4b7b3b05..d446ed6ab3d221475430ce53eb81c8d2c537f275 100644 (file)
@@ -4,7 +4,7 @@ use Test::More;
 
 use LWP::UserAgent;
 use HTTP::Request ();
-plan tests => 6;
+plan tests => 18;
 
 # Prevent environment from interfering with test:
 delete $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME};
@@ -15,34 +15,38 @@ delete $ENV{PERL_LWP_SSL_CA_PATH};
 delete $ENV{PERL_LWP_ENV_PROXY};
 
 # we can only use HTTP::Request >= 6.07
-my $ver = $HTTP::Request::VERSION || '6.00';
-my $ver_ok = eval {HTTP::Request->VERSION("6.07");};
-my $patch_ver_ok = eval {HTTP::Request->VERSION("6.12");};
+my $ver          = $HTTP::Request::VERSION || '6.00';
+my $ver_ok       = eval { HTTP::Request->VERSION("6.07"); };
+my $patch_ver_ok = eval { HTTP::Request->VERSION("6.12"); };
 diag "Some tests for the PUT/PATCH methods can only be run on ";
 diag "HTTP::Request version 6.07/6.12 or higher.";
 diag "If your version isn't good enough, we'll skip those.";
-diag "Your version is $ver and that's ". ($ver_ok ? '' : 'not '). 'good enough';
+diag "Your version is $ver and that's "
+    . ($ver_ok ? '' : 'not ')
+    . 'good enough';
 
 # default_header 'Content-Type' should be honored in POST/PUT
 # if the "Content => 'string'" form is used. Otherwise, x-www-form-urlencoded
 # will be used
 my $url = "http://www.example.com";
-my $ua = LWP::UserAgent->new;
+my $ua  = LWP::UserAgent->new;
 $ua->default_header('Content-Type' => 'application/json');
 $ua->proxy(http => "loopback:");
 $ua->agent("foo/0.1");
 
 # These forms will all be x-www-form-urlencoded
 subtest 'PATCH x-www-form-urlencoded' => sub {
-    plan skip_all => "HTTP::Request version not high enough" unless $patch_ver_ok;
+    plan skip_all => "HTTP::Request version not high enough"
+        unless $patch_ver_ok;
     plan tests => 4;
     for my $arg (
-        [ { cat => 'dog' }             ],
-        [ [ cat => 'dog' ]             ],
-        [ Content => { cat => 'dog' }, ],
-        [ Content => [ cat => 'dog' ], ],
-    ) {
-        is ($ua->patch($url, @$arg)->content, <<"EOT", "patch @$arg");
+        [{cat => 'dog'}],
+        [[cat => 'dog']],
+        [Content => {cat => 'dog'},],
+        [Content => [cat => 'dog'],],
+        )
+    {
+        is($ua->patch($url, @$arg)->content, <<"EOT", "patch @$arg");
 PATCH http://www.example.com
 User-Agent: foo/0.1
 Content-Length: 7
@@ -56,14 +60,15 @@ EOT
 # These forms will all be x-www-form-urlencoded
 subtest 'PUT x-www-form-urlencoded' => sub {
     plan skip_all => "HTTP::Request version not high enough" unless $ver_ok;
-    plan tests => 4;
+    plan tests    => 4;
     for my $arg (
-        [ { cat => 'dog' }             ],
-        [ [ cat => 'dog' ]             ],
-        [ Content => { cat => 'dog' }, ],
-        [ Content => [ cat => 'dog' ], ],
-    ) {
-        is ($ua->put($url, @$arg)->content, <<"EOT", "put @$arg");
+        [{cat => 'dog'}],
+        [[cat => 'dog']],
+        [Content => {cat => 'dog'},],
+        [Content => [cat => 'dog'],],
+        )
+    {
+        is($ua->put($url, @$arg)->content, <<"EOT", "put @$arg");
 PUT http://www.example.com
 User-Agent: foo/0.1
 Content-Length: 7
@@ -78,12 +83,13 @@ EOT
 subtest 'POST x-www-form-urlencoded' => sub {
     plan tests => 4;
     for my $arg (
-        [ { cat => 'dog' }             ],
-        [ [ cat => 'dog' ]             ],
-        [ Content => { cat => 'dog' }, ],
-        [ Content => [ cat => 'dog' ], ],
-    ) {
-        is ($ua->post($url, @$arg)->content, <<"EOT", "post @$arg");
+        [{cat => 'dog'}],
+        [[cat => 'dog']],
+        [Content => {cat => 'dog'},],
+        [Content => [cat => 'dog'],],
+        )
+    {
+        is($ua->post($url, @$arg)->content, <<"EOT", "post @$arg");
 POST http://www.example.com
 User-Agent: foo/0.1
 Content-Length: 7
@@ -98,9 +104,9 @@ EOT
 for my $call (qw(post put patch)) {
     my $ucall = uc $call;
 
-    my $arg = [ Content => '{"cat":"dog"}' ];
+    my $arg = [Content => '{"cat":"dog"}'];
 
-    is ($ua->$call($url, @$arg)->content, <<"EOT", "$call @$arg");
+    is($ua->$call($url, @$arg)->content, <<"EOT", "$call @$arg");
 $ucall http://www.example.com
 User-Agent: foo/0.1
 Content-Length: 13
@@ -110,3 +116,45 @@ Content-Type: application/json
 EOT
 
 }
+
+# Provided Content-Type overrides default
+for my $call (qw(post put patch)) {
+    my $ucall = uc $call;
+
+    my $arg = ['Content-Type' => 'text/plain', Content => '{"cat":"dog"}'];
+
+    is($ua->$call($url, @$arg)->content,
+        <<"EOT", "$call @$arg with override CT");
+$ucall http://www.example.com
+User-Agent: foo/0.1
+Content-Length: 13
+Content-Type: text/plain
+
+{"cat":"dog"}
+EOT
+
+}
+
+# Any non-true content type means use default
+for my $ct (0, "", undef) {
+    for my $call (qw(post put patch)) {
+        my $ucall = uc $call;
+
+        my $arg = ['Content-Type' => $ct, Content => '{"cat":"dog"}'];
+
+        my $desc = defined($ct) ? $ct : "<undef>";
+
+        my @desc_arg = map { defined $_ ? $_ : "<undef>" } @$arg;
+
+        is($ua->$call($url, @$arg)->content,
+            <<"EOT", "$call @desc_arg with false override CT '$desc' uses default");
+$ucall http://www.example.com
+User-Agent: foo/0.1
+Content-Length: 13
+Content-Type: application/json
+
+{"cat":"dog"}
+EOT
+    }
+
+}
index 1fe8f8fe8f524d34621ae36aafc75c5f3514c010..d90f440ad404113395f84fc38b3bcb8b98cd50e0 100644 (file)
@@ -4,7 +4,10 @@ use Test::More;
 use Test::Fatal;
 
 use LWP::UserAgent;
-plan tests => 2;
+plan tests => 8;
+
+# in case already defined in user's environment
+delete $ENV{$_} for qw(REQUEST_METHOD HTTP_PROXY http_proxy CGI_HTTP_PROXY NO_PROXY no_proxy);
 
 for my $varname ( qw(ABSURDLY_NAMED_PROXY MY_PROXY) ) {
     $ENV{ $varname } = "foobar";
@@ -13,3 +16,70 @@ for my $varname ( qw(ABSURDLY_NAMED_PROXY MY_PROXY) ) {
     is(exception{ $ua->env_proxy(); }, undef, "proxy: with env: $varname: no errors");
     delete $ENV{$varname};
 }
+
+# simulate CGI environment
+{
+    local $ENV{REQUEST_METHOD} = 'GET';
+    local $ENV{HTTP_PROXY}     = 'something';
+    my $ua = LWP::UserAgent->new;
+    $ua->env_proxy();
+    is $ua->proxy('http'), undef, 'HTTP_PROXY ignored in CGI environment';
+}
+
+{
+    local $ENV{REQUEST_METHOD} = 'GET';
+    local $ENV{CGI_HTTP_PROXY} = 'http://proxy.example.org:3128/';
+    my $ua = LWP::UserAgent->new;
+    $ua->env_proxy();
+    is $ua->proxy('http'), 'http://proxy.example.org:3128/',
+        'substitute CGI_HTTP_PROXY used in CGI environment';
+}
+
+SKIP: {
+    skip "Environment variables are case-sensitive on this platform", 1
+       if do {
+           local $ENV{TEST_CASE_SENSITIVITY} = "a";
+           local $ENV{test_case_sensitivity} = "b";
+           $ENV{TEST_CASE_SENSITIVITY} eq $ENV{test_case_sensitivity};
+       };
+    my @warnings;
+    local $SIG{__WARN__}   = sub { push @warnings, @_ };
+    local $ENV{HTTP_PROXY} = 'http://uppercase-proxy.example.org:3128/';
+    local $ENV{http_proxy} = 'http://lowercase-proxy.example.org:3128/';
+    my $ua = LWP::UserAgent->new;
+    $ua->env_proxy();
+    (my $warnings = "@warnings") =~ s{ at .*\n}{};
+    is $warnings, qq{Environment contains multiple differing definitions for 'http_proxy'.\nUsing value from 'HTTP_PROXY' (http://uppercase-proxy.example.org:3128/) and ignoring 'http_proxy' (http://lowercase-proxy.example.org:3128/)},
+        'expected warning on multiple definitions';
+}
+
+{
+    my @warnings;
+    local $SIG{__WARN__}   = sub { push @warnings, @_ };
+    local $ENV{HTTP_PROXY} = 'http://proxy.example.org:3128/';
+    local $ENV{http_proxy} = 'http://proxy.example.org:3128/';
+    my $ua = LWP::UserAgent->new;
+    $ua->env_proxy();
+    is_deeply \@warnings, [],
+        "No warnings if multiple definitions for 'http_proxy' exist, but with the same value";
+}
+
+{
+    local $ENV{NO_PROXY} = 'localhost,example.com';
+    my $ua = LWP::UserAgent->new;
+    $ua->env_proxy();
+    is_deeply $ua->{no_proxy}, [qw(localhost example.com)],
+        'no_proxy from environment';
+}
+
+{
+    local $TODO = "Test case for GH #372";
+    my @warnings;
+    local $SIG{__WARN__}   = sub { push @warnings, @_ };
+    local $ENV{FOO} = 'BAR';
+    local $ENV{foo} = 'bar';
+    my $ua = LWP::UserAgent->new;
+    $ua->env_proxy();
+    is_deeply \@warnings, [],
+        "No warnings for unrelated environment variables";
+}
index bae8e2e8d8fe34baaff353eb428c74dfb88f5d87..e3036333199e703195576f854dc8b84fe101eaae 100644 (file)
@@ -8,7 +8,7 @@ if (($ENV{TRAVIS_PULL_REQUEST} || '') eq 'false') {
 
 note 'Checking Changes';
 my $changes_file = 'Changes';
-my $newver = '6.55';
+my $newver = '6.56';
 my $trial_token = '-TRIAL';
 my $encoding = 'UTF-8';