Google API错误,但仍然有效 [英] Google API error, but still works
问题描述
在连接到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屋!