1. Luke Plant
  2. django-piston

Commits

Joe Stump  committed 54c222d

Don't include extra parameters when request.method is POST and request.MIME['CONTENT_TYPE'] is "application/x-www-form-urlencoded" (See http://oauth.net/core/1.0a#rfc.section.5.2).

  • Participants
  • Parent commits 4630a92
  • Branches default

Comments (0)

Files changed (1)

File piston/authentication.py

View file
     """
     Shortcut for initialization.
     """
+    if request.method == "POST" and \
+       request.META['CONTENT_TYPE'] == "application/x-www-form-urlencoded":
+        params = dict(request.REQUEST.items())
+    else:
+        params = {}
+
     oauth_request = oauth.OAuthRequest.from_request(
         request.method, request.build_absolute_uri(), 
-        headers=request.META, parameters=dict(request.REQUEST.items()),
+        headers=request.META, parameters=params,
         query_string=request.environ.get('QUERY_STRING', ''))
         
     if oauth_request: