2

我收到以下警告:

WARNING  2011-09-21 20:25:32,259 urlfetch_stub.py] urlfetch received https://z_c
l.zzzz.me:10312/zzzz/Data/0 ; port 10312 is not allowed in production!

无论如何在生产中使用该端口?

4

1 回答 1

2

更新您的 SDK 版本!
自 2010 年 3 月 (SDK 1.3.2) 以来,GAE 允许更广泛的端口:80-90440-4501024-65535

他们从:

PORTS_ALLOWED_IN_PRODUCTION = (
    None, '80', '443', '4443', '8080', '8081', '8082', '8083', '8084', '8085',
    '8086', '8087', '8088', '8089', '8188', '8444', '8990')
if port not in PORTS_ALLOWED_IN_PRODUCTION:
        logging.warning(
          'urlfetch received %s ; port %s is not allowed in production!' %
          (url, port))

至:

def _IsAllowedPort(port):
  if port is None:
    return True
  try:
    port = int(port)
  except ValueError, e:
    return False
  if ((port >= 80 and port <= 90) or
      (port >= 440 and port <= 450) or
      port >= 1024):
    return True
  return False

if not _IsAllowedPort(port):
        logging.warning(
          'urlfetch received %s ; port %s is not allowed in production!' %
          (url, port))
于 2011-09-21T21:58:40.990 回答