谷歌云平台上的域名验证问题

谷歌云平台上的域名验证问题

本文介绍了谷歌云平台上的域名验证问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Google云平台上需要关于域验证问题的帮助。我正在尝试使用HTML标记方法验证我的appspot.com网址。我的html包含:

 < html> 
< head>
< meta name =google-site-verificationcontent =39k6VaTYfQcrqMGTZ1LDYXxlR4T0gtGeOTce68idUE0/>
< title>这是标题< / title>
< / head>
< body>
Hello world
< / body>
< / html>

我已将其命名为index.html,并在main.py中使用此html文件,如下所示:

 导入日志记录$ b $从瓶子导入瓶子,render_template $ b $从瓶子导入请求
导入os
导入请求
app = Flask(__ name__)

MESSAGES = []

@ app.route('/ pubsub / push',methods = [ 'POST'])
def pubsub_push():
if(request.args.get('token','')!=
current_app.config ['PUBSUB_VERIFICATION_TOKEN']):
返回'无效请求',400

envelope = json.loads(request.data.decode('utf-8'))
payload = base64.b64decode(envelope ['消息'] ['data'])

MESSAGES.append(有效载荷)

#返回任何2xx状态表示成功接收消息。
return'OK',200


@ app.route('/',methods = ['GET','POST'])
def index ):
if request.method =='GET':
return render_template('index.html',messages = MESSAGES)

data = request.form.get(' ('utf-8')

publisher = pubsub_v1.PublisherClient()
topic_path = publisher.topic_path(
current_app.config [ 'PROJECT'],
current_app.config ['PUBSUB_TOPIC'])

publisher.publish(topic_path,data = data)

返回'OK',200

在gcloud应用程序部署网址只是打印Hello world和验证失败,并显示消息:

  https://financelcr.appspot.com/使用元标记方法验证失败(不到一分钟前) 。您的元标记不在< head>中您的主页部分。 
验证您对https://financelcr.appspot.com/的所有权。学到更多。

请帮助解决问题。试图在Google Cloud存储设置对象更改通知,并且无法运行gsutil通知watchbucket .....,直到域被验证。任何帮助将不胜感激。

解决方案

有问题。标题需要低于标题。 具有正确的html格式。


need help on issue with domain verification on Google cloud platform. I am trying to verify my appspot.comweb url using HTML Tag method. My html contains:

<html>
<head>
<meta name="google-site-verification" content="39k6VaTYfQcrqMGTZ1LDYXxlR4T0gtGeOTce68idUE0" />
<title> This is title </title>
</head>
<body>
Hello world
</body>
</html>

I have named it as index.html and using this html file in main.py as below :

import logging
from flask import Flask,render_template
from flask import request
import os
import requests
app = Flask(__name__)

MESSAGES = []

@app.route('/pubsub/push', methods=['POST'])
def pubsub_push():
    if (request.args.get('token', '') !=
            current_app.config['PUBSUB_VERIFICATION_TOKEN']):
        return 'Invalid request', 400

    envelope = json.loads(request.data.decode('utf-8'))
    payload = base64.b64decode(envelope['message']['data'])

    MESSAGES.append(payload)

    # Returning any 2xx status indicates successful receipt of the message.
    return 'OK', 200


@app.route('/', methods=['GET', 'POST'])
def index():
    if request.method == 'GET':
        return render_template('index.html', messages=MESSAGES)

    data = request.form.get('payload', 'Example payload').encode('utf-8')

    publisher = pubsub_v1.PublisherClient()
    topic_path = publisher.topic_path(
        current_app.config['PROJECT'],
        current_app.config['PUBSUB_TOPIC'])

    publisher.publish(topic_path, data=data)

    return 'OK', 200

after "gcloud app deploy" the url https://financelcr.appspot.com/ just prints Hello world and verification is getting failed with message :

Verification failed for https://financelcr.appspot.com/ using the Meta tag method (less than a minute ago). Your meta tag is not in the <head> section of your home page.
Verify your ownership of https://financelcr.appspot.com/. Learn more.

Please help on how to resolve the issue. trying to set up Object Change Notification on Google Cloud storage and not not able to run "gsutil notification watchbucket https://financelcr.appspot.com/..... " until domain is verified. Any help will be much appreciated.

解决方案

Got the issue. Header need to be below title. https://support.google.com/webmasters/answer/35179 has the correct format of html.

这篇关于谷歌云平台上的域名验证问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-27 23:08