d.addCallback(_check2)
return d
+ def test_PUT_NEWFILE_URI_only_PUT(self):
+ d = self.PUT("/uri?t=bogus", "")
+ d.addBoth(self.shouldFail, error.Error,
+ "PUT_NEWFILE_URI_only_PUT",
+ "400 Bad Request",
+ "/uri only accepts PUT and PUT?t=mkdir")
+ return d
+
def test_PUT_NEWDIR_URI(self):
d = self.PUT("/uri?t=mkdir", "")
def _check(uri):
pass
class ILocalAccess(Interface):
def local_access_is_allowed():
- pass
+ """Return True if t=upload&localdir= is allowed, giving anyone who
+ can talk to the webserver control over the local (disk) filesystem."""
# we must override twisted.web.http.Request.requestReceived with a version
req.setResponseCode(http.BAD_REQUEST)
req.setHeader("content-type", "text/plain")
- return "/uri only accepts PUT"
+ return "/uri only accepts PUT and PUT?t=mkdir"
class Root(rend.Page):