]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blobdiff - src/allmydata/web/directory.py
webapi: don't allow ETags in t=info or t=rename-form, both are variable
[tahoe-lafs/tahoe-lafs.git] / src / allmydata / web / directory.py
index 80f5aa3deb4d41e3eb620c7f578fb1a5381f57e3..cf1d4d38ce3bf47d03bc35f46a57c8cd44059525 100644 (file)
@@ -154,7 +154,10 @@ class DirectoryNodeHandler(RenderMixin, rend.Page, ReplaceMeMixin):
         # This is where all of the directory-related ?t=* code goes.
         t = get_arg(req, "t", "").strip()
 
-        if not self.node.is_mutable():
+        # t=info contains variable ophandles, t=rename-form contains the name
+        # of the child being renamed. Neither is allowed an ETag.
+        FIXED_OUTPUT_TYPES =  ["", "json", "uri", "readonly-uri"]
+        if not self.node.is_mutable() and t in FIXED_OUTPUT_TYPES:
             si = self.node.get_storage_index()
             if si and req.setETag('DIR:%s-%s' % (base32.b2a(si), t or "")):
                 return ""