From 31c413e69514a9b99cf96f3382fb03dee6552d6f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 14 Nov 2011 11:01:22 +0000 Subject: [PATCH] http_file: use String#inspect on broken server response If we have a broken server, it could've spewed anything, so use #inspect to clean it up in case somebody put malicious escape sequences in the server response. --- lib/mogilefs/http_file.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/mogilefs/http_file.rb b/lib/mogilefs/http_file.rb index 96e9887..e2aa8dc 100644 --- a/lib/mogilefs/http_file.rb +++ b/lib/mogilefs/http_file.rb @@ -117,7 +117,8 @@ class MogileFS::HTTPFile < StringIO when %r{^HTTP/\d\.\d\s+(\d+)} raise BadResponseError, "HTTP response status from upload: #$1" else - raise UnparseableResponseError, "Response line not understood: #{line}" + raise UnparseableResponseError, + "Response line not understood: #{line.inspect}" end rescue => err rewind_or_raise!(uri, err) -- 2.11.4.GIT