abhi62003 / relax-net

Automatically exported from code.google.com/p/relax-net
GNU General Public License v3.0
0 stars 0 forks source link

Client doesn't work with CloudAnd Couchdb URIs #24

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Sign up for a free plan at Cloudant (https://cloudant.com/)
2. Use a certificate policy that ignores Cloudant's dud certificate: 
http://www.adampresley.com/2011_06_01_archive.html
3. Use Hammock with the Cloudant URI.
4. Get unauthorized result

What is the expected output? What do you see instead?
Expected working queries against Cloudant, got unautorized

What version of the product are you using? On what operating system?
SVN trunk

Please provide any additional information below.
I'm attaching a patch that fixes the problem.

Original issue reported on code.google.com by fri...@gmail.com on 29 Oct 2011 at 12:23

Attachments:

GoogleCodeExporter commented 9 years ago
That fix doesn't work. I changed the patch to this.

                var userInfo = request.Address.UserInfo;
                if (!string.IsNullOrEmpty(userInfo) && userInfo.Contains(':'))
                {
                    string authInfo = userInfo.Split(':').First() + ":" + userInfo.Split(':').Last();
                    authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo));
                    request.Headers["Authorization"] = "Basic " + authInfo;
                }

Original comment by kstrem...@gmail.com on 8 Nov 2012 at 2:24