google-code-export / gdata-python-client

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

misparses gsessionid from redirect URIs, leading to API failures due to exceeding redirects_remaining #572

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
gdata-python-client (2.0.x and hg tip) has a flaw in parsing the gsessionid out 
of redirect URIs due to a poor choice of regular expression used to match the 
session id value.

This manifests as intermittent api call failures (complaining about exceeding 
redirects_remaining) when performing calendar api calls. For some reason, this 
seems more prone to fail when performing write operations than read operations.

The fix is as follows:

-          m = re.compile('[\?\&]gsessionid=(\w*\-)').search(location)

+          m = re.compile('[\?\&]gsessionid=([^&]*)').search(location)

at all three locations that this code occurs in gdata/service.py

Original issue reported on code.google.com by m...@j.maxb.eu on 12 Dec 2011 at 10:29

GoogleCodeExporter commented 9 years ago
Hello,

Please use the client.py module instead of the service.py.

Thanks!
Alain

Original comment by ala...@google.com on 12 Dec 2011 at 10:35