Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-5532

Perl Thrift/HttpClient.pm headers bug

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.12.0, 0.13.0, 0.14.0, 0.15.0, 0.14.1, 0.14.2, 0.16.0
    • 0.17.0
    • Perl - Library
    • None

    Description

      When using the Perl library with the Thrift/HttpClient.pm the following error occurs:
      'Can\'t call method "clone" on unblessed reference at /usr/share/perl5/HTTP/Message.pm line 40, <GEN2> line 1.
      '

      This is happening because of these lines of code in Thrift/HttpClient.pm:

      https://github.com/apache/thrift/blob/79f89e0cec046ae7e6ed4a31ccfadd907be8baed/lib/perl/lib/Thrift/HttpClient.pm#L189-L190

      The HTTP::Request package expects the headers to either be an HTTP::Headers object or a plain array reference of key/value pairs. The super class HTTP::Message expects the same.

      But here we are instead passing a hash reference which is incorrect.

      This bug was introduced back in 2018 with this refactoring PR:

      https://github.com/apache/thrift/commit/8a130f63e5bd09e5c39f9760ba04b5ea0837ff4c#diff-c1101ee9588204db1c3ab744b4f50c932bf86c3ad4bef129b6a0a8a1e222bb98L187-L188

      In the process the correct setting of the headers was lost.

      Attachments

        Issue Links

          Activity

            People

              thefunster Finn Isaac Norris Colman
              thefunster Finn Isaac Norris Colman
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h