@@ -487,15 +487,23 @@ def do_AGENT(self):
487
487
else :
488
488
continue
489
489
490
+ # public gae appid deny this site request.
491
+ if response .app_status == 403 :
492
+ logging .warn ("public appid deny this host:%s" , host )
493
+ html = generate_message_html ('403 public Appid deny this host proxy' , u'共用appid因为资源有限,限制观看视频和文件下载等消耗资源过多的访问,请使用自己的appid' )
494
+ self .wfile .write (b'HTTP/1.0 403\r \n Content-Type: text/html\r \n \r \n ' + html .encode ('utf-8' ))
495
+ response .close ()
496
+ return
497
+
490
498
# appid not exists, try remove it from appid
491
499
if response .app_status == 404 :
492
500
logging .warning ('APPID %r not exists, remove it.' , response .ssl_sock .appid )
493
501
appid_manager .report_not_exist (response .ssl_sock .appid )
494
502
appid = appid_manager .get_appid ()
495
503
496
504
if not appid :
497
- html = generate_message_html ('404 No usable Appid Exists' , 'No usable Appid Exists, please add appid ' )
498
- self .wfile .write (b'HTTP/1.0 502 \r \n Content-Type: text/html\r \n \r \n ' + html .encode ('utf-8' ))
505
+ html = generate_message_html ('404 No usable Appid Exists' , u'没有可用appid了,请配置可用的appid ' )
506
+ self .wfile .write (b'HTTP/1.0 404 \r \n Content-Type: text/html\r \n \r \n ' + html .encode ('utf-8' ))
499
507
response .close ()
500
508
return
501
509
else :
@@ -508,8 +516,8 @@ def do_AGENT(self):
508
516
appid = appid_manager .get_appid ()
509
517
510
518
if not appid :
511
- html = generate_message_html ('404 No usable Appid Exists' , 'No usable Appid Exists, please add appid ' )
512
- self .wfile .write (b'HTTP/1.0 502 \r \n Content-Type: text/html\r \n \r \n ' + html .encode ('utf-8' ))
519
+ html = generate_message_html ('503 No usable Appid Exists' , u'appid流量不足,请增加appid ' )
520
+ self .wfile .write (b'HTTP/1.0 503 \r \n Content-Type: text/html\r \n \r \n ' + html .encode ('utf-8' ))
513
521
response .close ()
514
522
return
515
523
else :
0 commit comments