pepsi-zero / weboutlook

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

Newline in between cookie values causes failed login. (With fix) #2

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The newline in the Cookie output was causing my login to fail. This was fixed 
by changing line 90 
(in the get_page method of CookieScraper) from:

opener.addheader('Cookie', self._cookies.output(attrs=[], header='').strip())
to
opener.addheader('Cookie', self._cookies.output(attrs=[], 
header='').strip().replace('\r\n', '; '))

The behavior now mimics what I see with Firefox Live HTTP Headers when I login.

Original issue reported on code.google.com by 7tim...@googlemail.com on 22 Mar 2008 at 8:39

GoogleCodeExporter commented 8 years ago
I was getting HTTP error 400 'Bad Request ( The data is invalid.  )' during the 
login
and found that this change fixed it. Thanks.

Original comment by bruce.sc...@gmail.com on 23 Jul 2008 at 2:08

GoogleCodeExporter commented 8 years ago
I found this bug myself - I was getting the error:

    Couldn't find <base href> on page after logging in.

because login was failing and the script was getting redirected to login again.
My fix was the following (applied to the same line as original poster):

    opener.addheader('Cookie', self._cookies.output(attrs=[], header='',
sep=';').strip())

Shame that the script hasn't been corrected - in almost two years.

Original comment by ged...@gmail.com on 21 Feb 2010 at 6:48

GoogleCodeExporter commented 8 years ago
Are you guys that got this working using Exchange 2007 or 2003.  I'm on 2007 and
these suggestions aren't working for me.

Original comment by hpbrant...@gmail.com on 28 Apr 2010 at 6:52

GoogleCodeExporter commented 8 years ago
I was getting a 104, 'Connection reset by peer', and this fix worked for me.  
Thanks
so much!

(I'm on 2003, sorry hp.)

Original comment by ladene...@gmail.com on 20 May 2010 at 4:56

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I have the same issue, it's a long time passed since there have been comments, 
there is no new release that I know of, and none of the fixes here are giving 
me positive results.  It looks like this:

user=OCG\kbarrett
error: uncaptured python exception, closing channel <__main__.POPChannel 
connected 127.0.0.1:49430 at 0x97a17cc> (<class 
'scraper.RetrievalError'>:Couldn't find <base href> on page after logging in. 
[/usr/lib/python2.5/asyncore.py|read|68] 
[/usr/lib/python2.5/asyncore.py|handle_read_event|390] 
[/usr/lib/python2.5/asynchat.py|handle_read|137] 
[popdaemon.py|found_terminator|96] [popdaemon.py|pop_PASS|123] 
[/home/kbarrett/Desktop/weboutlook/weboutlook/scraper.py|login|147])

The help text mentions Copyright 2003, I am not the exchange admin of course, 
but I think I should be able to make it work! ^_^

Original comment by XULRunne...@gmail.com on 3 Dec 2010 at 5:10

GoogleCodeExporter commented 8 years ago
Thanks. ged....
Scripts works!
Amazing for the beginner like me. 

Original comment by rogersem...@gmail.com on 6 Oct 2012 at 3:12