Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-3439

PMT can't accept deflate (zlib) compressed content from the forge

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Incomplete
    • Affects Version/s: PUP 3.7.1
    • Fix Version/s: None
    • Component/s: PMT
    • Labels:
    • Template:
    • Team:
      Puppet Developer Experience

      Description

      When the PMT tool connects to the forge, it sends HTTP headers indicating it supports both gzip and deflate (zlib) compression formats. However, if the PMT tool is given deflate (zlib), it will choke with:

      Error: unknown compression method
      /Users/josh/work/puppet/lib/puppet/forge/repository.rb:105:in `inflate'
      /Users/josh/work/puppet/lib/puppet/forge/repository.rb:105:in `block in read_response'
      /Users/josh/.rbenv/versions/1.9.3-p545/lib/ruby/1.9.1/net/http.rb:746:in `start'
      /Users/josh/work/puppet/lib/puppet/forge/repository.rb:94:in `read_response'
      /Users/josh/work/puppet/lib/puppet/forge/repository.rb:48:in `make_http_request'
      /Users/josh/work/puppet/lib/puppet/forge.rb:114:in `make_http_request'
      /Users/josh/work/puppet/lib/puppet/forge.rb:98:in `fetch'
      

      Adrien Thebo discovered that rack (which the forge-api service uses) uses:
      https://github.com/rack/rack/blob/master/lib/rack/deflater.rb#L108-L109

      And if we modify the PMT to do:

      Zlib::Inflate.new(-Zlib::MAX_WBITS).inflate(response.read_body)
      

      then it works correctly.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            josh Josh Cooper
            QA Contact:
            Eric Thompson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support