Project

General

Profile

Actions

Feature #3344

closed

supporting rfc 5789 - http patch verb

Added by guilherme.silveira (Guilherme Silveira) almost 14 years ago. Updated almost 12 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:30426]

Description

=begin
I am sending a patch and Changelog file for trunk (should be the same
patch for 1.8) supporting the PATCH verb defined on the approved RFC
5789. Here is the link for such RFC:

http://tools.ietf.org/html/rfc5789

Patch should be used to partially update resources over the web using
a media type that gives enough information for such procedure.

The patch adds a new PATCH class, similar to POST. It also defines a
patch method to Net::HTTP instance. Finally, the code from post was
refactored out into a send_entity method, because patch and post
tunneling behavior are the same, with the only difference on which
http method being used.

Regards
=end


Files

ChangeLogPatch (516 Bytes) ChangeLogPatch guilherme.silveira (Guilherme Silveira), 05/26/2010 12:33 PM
ruby-patch-verb.patch (1.78 KB) ruby-patch-verb.patch guilherme.silveira (Guilherme Silveira), 05/26/2010 12:33 PM

Related issues 1 (0 open1 closed)

Has duplicate Ruby master - Misc #6299: Adding PATCH to Net::HTTPClosedActions
Actions #1

Updated by naruse (Yui NARUSE) almost 14 years ago

=begin
This feature is acceptable, but it also needs tests.

I'm making primitive tests like following.
If you have some tests it helps me.

diff --git a/test/net/http/test_http.rb b/test/net/http/test_http.rb
index 167eda9..76280ad 100644
--- a/test/net/http/test_http.rb
+++ b/test/net/http/test_http.rb
@@ -169,6 +169,25 @@ module TestNetHTTP_version_1_1_methods
assert_equal ["a=x1", "a=x2", "b=y"], res.body.split(/[;&]/).sort
end

  • def test_patch
  • start {|http|
  •  _test_patch__base http
    
  • }
  • end
  • def _test_patch__base(http)
  • uheader = {}
  • uheader['Accept'] = 'application/octet-stream'
  • data = 'patch data'
  • res, body = http.patch('/', data)
  • assert_kind_of Net::HTTPResponse, res
  • assert_kind_of String, body
  • assert_kind_of String, res.body
  • assert_equal data, body
  • assert_equal data, res.body
  • assert_equal data, res.entity
  • end

end

diff --git a/test/net/http/utils.rb b/test/net/http/utils.rb
index 10c88d7..32cea2a 100644
--- a/test/net/http/utils.rb
+++ b/test/net/http/utils.rb
@@ -92,6 +92,12 @@ module TestNetHTTPUtils
res.body = req.body
res.chunked = @chunked
end
+

  • def do_PATCH(req, res)
  •  res['Content-Type'] = req['Content-Type']
    
  •  res.body = req.body
    
  •  res.chunked = @chunked
    
  • end
    end
class NullWriter

=end

Actions #2

Updated by naruse (Yui NARUSE) almost 14 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r28119.
Guilherme, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Updated by tenderlovemaking (Aaron Patterson) almost 12 years ago

  • Description updated (diff)

What do you think about backporting these to 1.8.7 and 1.9.2? There are two backport tickets open for this:

http://bugs.ruby-lang.org/issues/6300

http://bugs.ruby-lang.org/issues/6299

Updated by ayumin (Ayumu AIZAWA) almost 12 years ago

IMHO, I'm not positive to patch it to 1.8.7 or 1.9.2, because these 2 versions will be unsupported soon.

--
Ayumu AIZAWA

Updated by nobu (Nobuyoshi Nakada) almost 12 years ago

No new features in dying branches.

Actions #7

Updated by naruse (Yui NARUSE) about 6 years ago

  • Has duplicate Misc #6299: Adding PATCH to Net::HTTP added
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0