Commits

Sylvain Hellegouarch committed eed7b76

Fixed #759

Comments (0)

Files changed (1)

cherrypy/lib/httpauth.py

         if not params.has_key(k):
             return None
 
-    # If qop is sent then cnonce and cn MUST be present
-    if params.has_key("qop") and not params.has_key("cnonce") \
-                                  and params.has_key("cn"):
+    # If qop is sent then cnonce and nc MUST be present
+    if params.has_key("qop") and not (params.has_key("cnonce") \
+                                      and params.has_key("nc")):
+        return None
+
+    # If qop is not sent, neither cnonce nor nc can be present
+    if (params.has_key("cnonce") or params.has_key("nc")) and \
+       not params.has_key("qop"):
         return None
 
     return params