<div dir="ltr"><div class="gmail_quote">On Thu, Sep 18, 2008 at 4:34 PM, Eric Will <span dir="ltr"><<a href="mailto:rakaur@malkier.net">rakaur@malkier.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I found my problem. As I figured, it was my fault. I hadn't counted on<br>
cnonce being base64-encoded, and in my code that forms the `response`<br>
hash I use, I split the string into key=>value by splitting on the '='<br>
sign. The cnonce had an '=' on the end of it, which was just getting<br>
lopped off. I've fixed this with:</blockquote><div><br></div><div>You shouldn't split it that way, because you also won't handle quoted strings with comma's correctly. Here's the regex I use:</div><div>
<br></div><div>(\w+\s*=\s*(?:(?:"[^"]+")|(?:[^,]+)))</div><div><br></div><div>you end up with one capture per key=value, then you can split that on the first = is the string, and then remove the quotes from the value if they exist.</div>
<div><br></div><div>(I guess the correct thing to do would be to write a proper tokenizer instead of string splitting, or regex)</div></div><br>-- <br>- Norman Rasmussen<br> - Email: <a href="mailto:norman@rasmussen.co.za">norman@rasmussen.co.za</a><br>
- Home page: <a href="http://norman.rasmussen.co.za/">http://norman.rasmussen.co.za/</a><br>
</div>