Skip to content

Commit

Permalink
* Use POST in record view
Browse files Browse the repository at this point in the history
  • Loading branch information
randomknowledge committed Mar 27, 2016
1 parent 5baf767 commit 35e1246
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions django_statsd/views.py
Expand Up @@ -135,6 +135,7 @@ def _process_stick(request):


@csrf_exempt
@require_http_methods(["POST"])
def record(request):
"""
This is a Django method you can link to in your URLs that process
Expand All @@ -146,10 +147,10 @@ def record(request):
you need for imposing security on this method, so that not just anyone
can post to it.
"""
if 'client' not in request:
if 'client' not in request.POST:
return http.HttpResponseBadRequest()

client = request['client']
client = request.POST.get('client')
if client not in clients:
return http.HttpResponseBadRequest()

Expand Down

0 comments on commit 35e1246

Please sign in to comment.