<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,6 +1,5 @@
 - Character set handling frontend (allow UTF-8 only for now)
 - Limits on input sizes - define constants
-- Implement PUT
 - access control on senstive HTTP operations e.g. PUT, DELETE
 - db implementations:
   - couchdb (done)</diff>
      <filename>TODO</filename>
    </modified>
    <modified>
      <diff>@@ -138,6 +138,43 @@ class WebTests(unittest.TestCase):
         self.assert_( content.strip() == '' )
 
     @Report
+    def testPUT(self):
+        self.body['uri'] = 'http://foobar.com/%s.html'\
+                        % sys._getframe().f_code.co_name
+        print self.body['uri']
+        response, content = self._post()
+        print response
+        self.assert_( response['status'] == '200' )
+        self.assert_( self.body['uri'] in content )
+        
+        uri = response['content-location']
+
+        self._init_http()
+        self.body['status'] = '404'
+        response, content = self._post()
+        self.assert_( response['status'] == '404' )
+
+        self._init_http()
+        self.body['status'] = '301'
+        self.body['location'] = 'http://local.ch/foobar.html'
+        response, content = self._post()
+        self.assert_( response['status'] == '301' )
+        self.assert_( self.body['location'] in content )
+
+        self._init_http()
+        self.body['status'] = '200'
+        self.body['location'] = None
+        response, content = self.http.request(
+            uri, 'PUT',
+            headers=self.headers,
+            body=urllib.urlencode(self.body)
+            )
+        print response
+        self.assert_( response['status'] == '200' )
+        self.assert_( content.strip() == '' )
+
+
+    @Report
     def testBadrequest(self):
         self.body['uri'] = 'http://foobar.com/%s.html'\
                         % sys._getframe().f_code.co_name</diff>
      <filename>dammit/webtests.py</filename>
    </modified>
    <modified>
      <diff>@@ -253,6 +253,9 @@ def reduce_uri(i, uri):
     uri to it's path (and left), if the object
     i contains an attribute reduceurl
     &quot;&quot;&quot;
+    if uri.startswith(&quot;http%3A%2F%2F&quot;):
+        uri = urllib2.unquote(uri)
+    
     reduceurl = True
     try:
         reduceurl = getattr(i, 'reduceurl').lower() != 'false'</diff>
      <filename>urldammit.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>aeb142648a0e94d8cafbbc54d0c90191a809283b</id>
    </parent>
  </parents>
  <author>
    <name>Harry Fuecks</name>
    <email>hfuecks@gmail.com</email>
  </author>
  <url>http://github.com/harryf/urldammit/commit/b0066d08cac46dcd6064f202b8119bb6f85df884</url>
  <id>b0066d08cac46dcd6064f202b8119bb6f85df884</id>
  <committed-date>2008-06-24T08:17:26-07:00</committed-date>
  <authored-date>2008-06-24T08:17:26-07:00</authored-date>
  <message>unquote urls if percent encoded</message>
  <tree>bba3b5987dc94572d0095f2a5cf9a4f7d3d59ce9</tree>
  <committer>
    <name>Harry Fuecks</name>
    <email>hfuecks@gmail.com</email>
  </committer>
</commit>
