From 049da57a6000cac1313a1f2f461a29884c315a43 Mon Sep 17 00:00:00 2001 From: Julian Viereck Date: Thu, 22 Apr 2010 20:46:04 +0200 Subject: [PATCH] Saveas shouldn't work when saving to a folder and there is some content; bug 558670 --- bespin/controllers.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bespin/controllers.py b/bespin/controllers.py index 4beb4fa..efc235b 100644 --- a/bespin/controllers.py +++ b/bespin/controllers.py @@ -273,6 +273,10 @@ def putfile(request, response): user = request.user owner, project, path = _split_path(request) + + if (path == '' or path.endswith('/')) and request.body: + raise BadRequest("Path ended in '/' indicating directory, but request contains body text") + project = get_project(user, owner, project, create=True) if path.endswith('/'):