V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
guotie

不能发帖的bug

  •  
  •   guotie · Dec 17, 2011 · 8650 views
    This topic created in 5249 days ago, the information mentioned may be changed or developed.
    现象描述:

    前几天从github下载的代码,部署以后,发现无法发帖。

    点击创建后,没有提示,直接返回根路径。

    BUG:
    在topic.py文件118行,NewTopicHandler类的post方法中,有以下检查:
    if ('Host' in self.request.headers):
    if (self.request.headers['Host'] not in ['www.v2ex.com', 'v2ex.appspot.com', 'fast.v2ex.com', 'beta.v2ex.com', 'us.v2ex.com', 'jp.v2ex.com', 'eu.v2ex.com', 'localhost:10000']):
    can_continue = False
    else:
    can_continue = False

    这样,只有部署在v2ex上,才能发帖。

    解决方法:
    注释掉这些代码。
    3 replies    1970-01-01 08:00:00 +08:00
    guotie
        2
    guotie  
    OP
       Dec 17, 2011
    原来如此啊
    frog
        3
    frog  
       May 29, 2012
    PB3什么时候出呀
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2357 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 10:58 · PVG 18:58 · LAX 03:58 · JFK 06:58
    ♥ Do have faith in what you're doing.