From 53d16b4fb428f8b06e47ac69066af4fc0c7e1910 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Wed, 9 Apr 2014 09:51:05 -0700 Subject: reorder middleware in chef::http::simple the api here reverses the order of the reversed order in the responses for some reason. this broke remote_file for most of the internet. --- lib/chef/http/simple.rb | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'lib/chef/http') diff --git a/lib/chef/http/simple.rb b/lib/chef/http/simple.rb index d675a17ee8..40ac864224 100644 --- a/lib/chef/http/simple.rb +++ b/lib/chef/http/simple.rb @@ -7,15 +7,12 @@ class Chef class HTTP class Simple < HTTP - + # When we 'use' middleware the first middleware is applied last on requests and + # first on responses (confusingly). So validatecontentlength must come before + # decompressor in order to be applied before decmopressing the response. + use ValidateContentLength use Decompressor use CookieManager - - # ValidateContentLength should come after Decompressor - # because the order of middlewares is reversed when handling - # responses. - use ValidateContentLength - end end end -- cgit v1.2.1