Merge pull request #324 from pdvyas/website-only-get

[minor] send 404 if POST request non cmd (ie website)
This commit is contained in:
Pratik Vyas 2013-12-02 02:48:09 -08:00
commit 0aa597a2bd

View file

@ -8,7 +8,7 @@ sys.path.insert(0, 'lib')
from werkzeug.wrappers import Request, Response
from werkzeug.local import LocalManager
from webnotes.middlewares import StaticDataMiddleware
from werkzeug.exceptions import HTTPException
from werkzeug.exceptions import HTTPException, NotFound
from werkzeug.contrib.profiler import ProfilerMiddleware
from webnotes import get_config
@ -53,8 +53,10 @@ def application(request):
if webnotes.form_dict.cmd:
webnotes.handler.handle()
else:
elif webnotes.local.request.method == 'GET':
webnotes.webutils.render(webnotes.request.path[1:])
else:
raise NotFound
except HTTPException, e:
return e