# Redirect to the paste
return self.redirect("/view/%s" % paste.uuid)
+ # cURL Interface
+
+ def check_xsrf_cookie(self):
+ # Skip the check on PUT
+ if self.request.method == "PUT":
+ return
+
+ # Perform the check as usual
+ super().check_xsrf_cookie()
+
+ # XXX implement HTTP Basic authentication
+
+ @base.ratelimit(minutes=15, requests=5)
+ def put(self):
+ with self.db.transaction():
+ paste = self.backend.nopaste.create(
+ self.request.body, address=self.get_remote_ip())
+
+ # Send a message to the client
+ self.write("https://%s/view/%s\n" % (self.request.host, paste.uuid))
+
+ # All done
+ self.finish()
+
class RawHandler(base.AnalyticsMixin, base.BaseHandler):
def get(self, uid):