lib/lamby/handler.rb in lamby-2.5.2 vs lib/lamby/handler.rb in lamby-2.5.3

- old
+ new

@@ -45,10 +45,11 @@ end def base64_encodeable? @headers && ( @headers['Content-Transfer-Encoding'] == 'binary' || + content_encoding_compressed? || @headers['X-Lamby-Base64'] == '1' ) end def body64 @@ -78,7 +79,11 @@ else @app.call rack.env end end + def content_encoding_compressed? + content_encoding_header = @headers['Content-Encoding'] || '' + content_encoding_header.split(', ').any? { |h| ['br', 'gzip'].include?(h) } + end end end