Problem with signing - dependent on number of comma's?


I’m working on a desktop application that supports Twitter. I’m stuck with a very weird issue with signing. My application takes a consumer key/secret pair, and a user token/secret pair to sign requests. I’m trying to update a user’s status with a user given message.

Everything works just fine, as long as an EVEN number of comma’s is used in the status. Yes, you read that right. If I try to send the following text, everything works just fine and my tweet is posted:

"Why, U hate my, commas Twitter..." (2 comma's)

But when I change this into the following:

"Why, U hate my, commas, Twitter..." (3 comma's)

It doesn’t work anymore… But changing this into:

"Why, U hate, my, commas, Twitter..." (4 comma's)

Works again!

I’m completely flabbergasted. It appears that my OAuth header code works as it’s supposed to, since posting text works most of the time. But as said, in certain cases it simply refuses to work, depending on the number of comma’s…? (NOTE: all of my comma’s are converted to %2C when URL encoded…)

If anyone has any clue, I’d be greatly in their debt!


Ok, I finally was able to fix this myself. I accidentally put all my variables (including the status for an update) into my Authentication header, while only authentication related variables are supposed to go there. Removing those fixed all of my issues. As all of this is clearly stated in the documentation, I’m to blame.

However, I cannot explain why it worked before (more or less) when I still put those variables in there. Any Twitter developers around who can shed a light on this?