ufairiya / mongoose

Automatically exported from code.google.com/p/mongoose
MIT License
0 stars 0 forks source link

Authorization fail with Internet Explorer 8 #206

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Protect a directory
2. Try to open it with IE 8 with a correct username/password.

What is the expected output? What do you see instead?

You should see the page loading. Instead of that Mongoose fails to authorize 
the request. The problem is in the function parse_auth_header at the following 
line:

 value = skip(&s, " ");

IE 8 doesn't use space (" ") to separate fields, just comma (","). An example:

With firefox:
username="me", realm="Myserver", nonce="1264230721", uri="/something.html", 
response="2fd1d5d05f728d346e51929b49e59dc8", qop=auth, nc=00000117, 
cnonce="bab6b21d1417b4e7"

With IE:
username="me",realm="Myserver",nonce="1264230721",uri="/something.html",response
="2fd1d5d05f728d346e51929b49e59dc8",qop=auth,nc=00000117,cnonce="bab6b21d1417b4e
7"

Possible solution:

Change this line:
 value = skip(&s, " ");

To these lines:
 value = skip(&s, ",");
 // Remove spaces
 if (name[0] == ' ') {
   name++;
 }

This solution works for me.

Original issue reported on code.google.com by morape...@gmail.com on 20 Nov 2010 at 10:24

GoogleCodeExporter commented 9 years ago
Submitted 
http://code.google.com/p/mongoose/source/detail?r=384ea3daf9cda9a85c553caafcd105
06526b31ca

Thank you.

Original comment by valenok on 29 Nov 2010 at 1:32