aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/net/http.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb
index bc181c01af..663b901a96 100644
--- a/lib/net/http.rb
+++ b/lib/net/http.rb
@@ -1504,7 +1504,13 @@ module Net #:nodoc:
begin
begin_transport req
res = catch(:response) {
- req.exec @socket, @curr_http_version, edit_path(req.path)
+ begin
+ req.exec @socket, @curr_http_version, edit_path(req.path)
+ rescue Errno::EPIPE
+ # Failure when writing full request, but we can probably
+ # still read the received response.
+ end
+
begin
res = HTTPResponse.read_new(@socket)
res.decode_content = req.decode_content