Comments (19)
当服务器返回的 header 中有多个 Set-Cookie 域时,比如一般的
wordpress 返回的 header
中,Set-Cookie 域至少有三个,GAPPProxy
会把它作为一个串传给本地浏览器。
---------------------------
Confirmed, it's indeed a bug.
解决办法很简单,将这个长串用 split(',
')切开,同样设置三个 Set-Cookie 域即可。
---------------------------
"," is a valid character in cookie. for instance:
wordpress=lovelywcm%7C1248344625%7C26c45bab991dcd0b1f3bce6ae6c78c92;
expires=Thu,
23-Jul-2009 10:23:45 GMT; path=/wp-content/plugins; domain=.wordpress.com;
httponly
split(', ') would result in another bug.
Original comment by lovelywcm
on 10 Jul 2009 at 1:53
- Changed state: Accepted
from gappproxy.
"," is a valid character in cookie. for instance:
wordpress=lovelywcm%7C1248344625%7C26c45bab991dcd0b1f3bce6ae6c78c92;
expires=Thu,
23-Jul-2009 10:23:45 GMT; path=/wp-content/plugins; domain=.wordpress.com;
httponly
split(', ') would result in another bug.
--------------------------------------------
OK. Then we have to work on the server side...;)
Original comment by solrex
on 10 Jul 2009 at 2:58
from gappproxy.
A update patch to fix this bug:
Index: fetch.py
===================================================================
--- fetch.py (revision 92)
+++ fetch.py (working copy)
@@ -29,6 +29,7 @@
from google.appengine.ext import webapp
from google.appengine.api import urlfetch
from google.appengine.api import urlfetch_errors
+import re
# from accesslog import logAccess
@@ -153,14 +154,12 @@
if header.strip().lower() in self.HtohHdrs:
# don't forward
continue
- ## there may have some problems on multi-cookie process in
urlfetch.
- #if header.lower() == 'set-cookie':
- # logging.info('O %s: %s' % (header, resp.headers[header]))
- # scs = resp.headers[header].split(',')
- # for sc in scs:
- # logging.info('N %s: %s' % (header, sc.strip()))
- # self.response.out.write('%s: %s\r\n' % (header,
sc.strip()))
- # continue
+ # there may have some problems on multi-cookie process in urlfetch.
+ if header.lower() == 'set-cookie':
+ scs = re.sub(r', ([^;]+=)', r'\n\1',
resp.headers[header]).split('\n')
+ for sc in scs:
+ self.response.out.write('%s: %s\r\n' % (header,
sc.strip()))
+ continue
# other
self.response.out.write('%s: %s\r\n' % (header, resp.headers[header]))
# check Content-Type
Original comment by solrex
on 10 Jul 2009 at 5:18
from gappproxy.
Update:
To avoid ', ' appears near the end of a cookie line,
scs = re.sub(r', ([^;]+=)', r'\n\1', resp.headers[header]).split('\n')
should be modified to:
scs = re.sub(r', ([^,;]+=)', r'\n\1', resp.headers[header]).split('\n')
Original comment by solrex
on 10 Jul 2009 at 6:23
from gappproxy.
Add a patched fetch.py file for ease of use.
Original comment by solrex
on 10 Jul 2009 at 6:56
Attachments:
from gappproxy.
我也遇到过类似情形,nokia
s40系统只能获取到单行的Set-Cookie信息。
单行Set-Cookie设置多个cookie信息,他们之间的分割符采用的是�
��么,是\n么?
我使用\n会报错,最后用的是\r。
Original comment by bit.kevin
on 18 Aug 2009 at 7:18
from gappproxy.
修改上传以后,facebook还是有问题啊
Original comment by [email protected]
on 11 Oct 2009 at 1:09
from gappproxy.
都到现在了 还没有一个完美的解决方案吗?真让人头疼
那些修改过的补丁我也试过 但是依然出现很多问题
Original comment by [email protected]
on 24 Oct 2009 at 2:35
from gappproxy.
试用solrex2上传到服务端,用webkit内核的浏览器登陆twitter没问
题。
Original comment by [email protected]
on 20 Nov 2009 at 5:39
from gappproxy.
我用了新的fetch.py依然无法登录twitter
Original comment by [email protected]
on 28 Jan 2010 at 2:36
from gappproxy.
用了新的fetch.py后可以登录twitter。
继续测试facebook
Original comment by [email protected]
on 28 Jan 2010 at 10:33
from gappproxy.
twitter facebook登录都可以。
在浏览器里排除一些不需要代理的外国网站,还可以玩facebook
的网页flash游戏,效果不错
Original comment by [email protected]
on 29 Jan 2010 at 1:31
from gappproxy.
my patch
--- fetch.py 2010-03-03 11:30:41.000000000 +0800
+++ fetch.py 2010-03-03 11:30:21.000000000 +0800
@@ -156,13 +156,14 @@
# don't forward
continue
## there may have some problems on multi-cookie process in urlfetch.
- #if header.lower() == 'set-cookie':
- # logging.info('O %s: %s' % (header, resp.headers[header]))
- # #scs = resp.headers[header].split(',')
- # for sc in scs:
- # logging.info('N %s: %s' % (header, sc.strip()))
- # self.response.out.write('%s: %s\r\n' % (header,
sc.strip()))
- # continue
+ if header.lower() == 'set-cookie':
+ logging.info('O %s: %s' % (header, resp.headers[header]))
+ #scs = resp.headers[header].split(',')
+ scs = re.split('(?<!Mon|Tue|Wed|Thu|Fri|Sat|Sun), ',
resp.headers[header])
+ for sc in scs:
+ logging.info('N %s: %s' % (header, sc.strip()))
+ self.response.out.write('%s: %s\r\n' % (header,
sc.strip()))
+ continue
# other
self.response.out.write('%s: %s\r\n' % (header, resp.headers[header]))
# check Content-Type
Original comment by [email protected]
on 3 Mar 2010 at 5:50
from gappproxy.
xlambda's patch is working!LOL
Original comment by [email protected]
on 30 May 2010 at 7:11
from gappproxy.
用了那个9.7k的fetch.py 还是无法正常登陆facebook & twitter。
期望有人能早日做出解决这个bug的新版本程序
Original comment by [email protected]
on 17 Jun 2010 at 9:42
from gappproxy.
#15 try http://zi.mu/kst, upload gae_server with SDUpload
Original comment by [email protected]
on 17 Jun 2010 at 2:28
from gappproxy.
Thanks for upstairs, but I don't know how to download anything from the site
you leave to me. If possible, could you please sent the new version of py file
to my email: [email protected]
Thank you so much.
Original comment by [email protected]
on 27 Jun 2010 at 5:31
from gappproxy.
[deleted comment]
from gappproxy.
This patch solves problem that multi-Set-Cookie which a following cookie name
start with number(0~9) will be returned together in version 113.
Index: fetch.py
===================================================================
--- fetch.py (版本 113)
+++ fetch.py (工作副本)
@@ -167,8 +167,8 @@
for sc in scs:
if nsc == "":
nsc = sc
- elif re.match(r"[ \t]*[0-9]", sc):
- # expires 2nd part
+ elif nsc[-3:] in
("Mon","Tue","Wed","Thu","Fri","Sat","Sun"):
+ # expires 2nd part
nsc += "," + sc
else:
# new one
Original comment by [email protected]
on 19 Jan 2011 at 1:04
from gappproxy.
Related Issues (20)
- 324错误是怎么回事? HOT 4
- iphone上如何使用
- 求助:无法访问google服务
- 作者您好,已经成功运行了,但是如果暂时不用的话如何停止呢?
- B HOT 1
- Break Wall 3.0 苹果新一代穿越天网工具发布,支持Apjp、Goagent、Snova、Wallproxy和Gappproxy!
- 希望提供DNS代理接囗
- 请问能否提供一个MAC的客户端呢? HOT 2
- 02
- Twitter 证书出错解决方法
- 多个账号自动切换
- symbian手机用gappproxy
- 2.0不能用1.6.5可以
- Exception happened during processing of request from <'127.0.0.1',*>
- Suggestion of Gapproxy
- 这个和goagent有什么区别, HOT 1
- [deleted issue]
- Can't open http://xxx.appspot.com/fetch.py
- Use SSH Tunnel via GaapProxy
- 部署服务器后 不能登陆那个网页
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gappproxy.