Google API错误,但仍然有效 [英] Google API error, but still works

查看:122
本文介绍了Google API错误,但仍然有效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在连接到Google Drive API时,我在本地主机上得到了这个控制台错误,但我在脚本中配置的选择器成功显示了我的驱动器的内容:


未能在'DOMWindow'上执行'postMessage':提供的目标原点(' https://docs.google '')与收件人窗口的来源不符(' http:// localhost:8000 ')。

加载 https://docs.google.com/picker?protocol=gadgets&origin=http%3A%2F%2Flocalho ... 2photos%22)) & rpctoken = yxxydsx40r21& rpcService = 2dngvfb4tj9x& thirdParty = true':'ALLOW-FROM http:// localhost:8000 '不是公认的d irective。标题将被忽略。


我忽略这一点,还是会给我带来麻烦?

解决方案

您必须控制Google的HTTP标头,确保使用有效的选项
X-Frame-Options


Im getting this console error on my localhost when connecting to google drive API, but the picker I have configured in my script successfully displays my drive's contents:

Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://docs.google.com') does not match the recipient window's origin ('http://localhost:8000').

Invalid 'X-Frame-Options' header encountered when loading 'https://docs.google.com/picker?protocol=gadgets&origin=http%3A%2F%2Flocalho…2photos%22))&rpctoken=yxxydsx40r21&rpcService=2dngvfb4tj9x&thirdParty=true': 'ALLOW-FROM http://localhost:8000' is not a recognized directive. The header will be ignored.

Do I ignore this or will it introduce trouble for me down the road?

解决方案

You have to control Google's HTTP headers , make sure to use valid options X-Frame-Options

这篇关于Google API错误,但仍然有效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆