【问题标题】:Issue in domain verification on google cloud platform谷歌云平台域名验证问题
【发布时间】:2017-09-25 06:34:48
【问题描述】:

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

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

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

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

在“gcloud app deploy”之后,url https://financelcr.appspot.com/ 只是打印 Hello world 并且验证失败并显示消息:

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.

请帮助解决问题。尝试在 Google Cloud 存储上设置对象更改通知,并且在验证域之前无法运行“gsutil notification watchbucket https://financelcr.appspot.com/.....”。任何帮助将不胜感激。

【问题讨论】:

    标签: python google-app-engine google-cloud-pubsub


    【解决方案1】:

    有问题。标题需要在标题下方。 https://support.google.com/webmasters/answer/35179 的 html 格式正确。

    【讨论】:

      猜你喜欢
      • 2020-12-11
      • 2017-10-06
      • 2022-11-22
      • 2018-05-31
      • 1970-01-01
      • 2019-03-17
      • 1970-01-01
      • 2020-08-12
      • 1970-01-01
      相关资源
      最近更新 更多