summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-18 17:29:55 +0000
committeraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-18 17:29:55 +0000
commitc6d466641ae2b5c8736255ac991944d7ebd6acac (patch)
treebfa21d761aebf3a0fef1e5d1804ef8d59feacf8f
parente88da3dc21c67d3ea3036f6628cdfa31cd6a69a2 (diff)
downloadruby-c6d466641ae2b5c8736255ac991944d7ebd6acac.tar.gz
ruby-c6d466641ae2b5c8736255ac991944d7ebd6acac.tar.xz
ruby-c6d466641ae2b5c8736255ac991944d7ebd6acac.zip
* lib/net/http.rb: support TRACE.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--lib/net/http.rb12
2 files changed, 16 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 2d304d5a5..f774b47b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Wed May 19 02:29:36 2004 Minero Aoki <aamine@loveruby.net>
+
+ * lib/net/http.rb: support TRACE.
+
Wed May 19 02:21:53 2004 Minero Aoki <aamine@loveruby.net>
* lib/net/http.rb: do not use class variables.
diff --git a/lib/net/http.rb b/lib/net/http.rb
index ed68c81a1..de89f090f 100644
--- a/lib/net/http.rb
+++ b/lib/net/http.rb
@@ -799,6 +799,12 @@ module Net # :nodoc:
request(Mkcol.new(path, initheader), body)
end
+ # Sends a TRACE request to the +path+ and gets a response,
+ # as an HTTPResponse object.
+ def trace(path, initheader = nil)
+ request(Trace.new(path, initheader))
+ end
+
# Sends a GET request to the +path+ and gets a response,
# as an HTTPResponse object.
#
@@ -1503,6 +1509,12 @@ e @header.each_key(&block)
REQUEST_HAS_BODY = true
RESPONSE_HAS_BODY = true
end
+
+ class Trace < HTTPRequest
+ METHOD = 'TRACE'
+ REQUEST_HAS_BODY = false
+ RESPONSE_HAS_BODY = true
+ end
end