Ebeo / google-gdata

Automatically exported from code.google.com/p/google-gdata
0 stars 0 forks source link

OAuth and systems using ',' as decimal separator #341

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have found another issue with OAuth and systems that use ',' as a decimal 
separator (such as French).  The timestamp for OAuth trims off decimal 
characters following a '.' character.  This also needs modifying to trim off 
decimal places with ','.  The code is:

            int commaIndex = timeStamp.IndexOf(",");
            if (commaIndex != -1)
                timeStamp = timeStamp.Substring(0, commaIndex);

And this needs to go in oauthutil.cs at line 43.

Without this fix the timestamp is incorrect and leads to an 'unknown 
authorisation headed' for OAuth requests from these systems.

Original issue reported on code.google.com by snae....@gmail.com on 24 Feb 2010 at 12:05

GoogleCodeExporter commented 9 years ago
I fixed this slightly differently (using CultureInfo). Please sync and verify.

Frank

Original comment by fman...@gmail.com on 19 Mar 2010 at 3:14

GoogleCodeExporter commented 9 years ago
I had changed my fix to use:

int pointIndex = 
timeStamp.IndexOf(System.Globalization.NumberFormatInfo.CurrentInfo.NumberDecima
lSepa
rator);

CultureInfo should also be fine.

My initial fix was a little childish...

Original comment by snae....@gmail.com on 19 Mar 2010 at 4:35