GAE 的 urlfetch 不适用于端口 10312?

发布于 2024-12-05 16:54:00 字数 216 浏览 2 评论 0原文

我收到以下警告:

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!

是否可以在生产中使用该端口?

I am getting the following warning:

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!

Is there anyway to use that port in Production?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

相权↑美人 2024-12-12 16:54:00

更新您的 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))

Update your SDK version!
Since march 2010 (SDK 1.3.2), GAE has allowed a wider range of ports: 80-90, 440-450, 1024-65535.

They switched from:

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))

to:

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))
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文