我正在尝试使用Google Map Places搜索框API,但是我尝试相应地修改内容安全政策,但最终出现以下错误。
HTML:
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: http://XXXX.projectsbit.org https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' https://maxcdn.bootstrapcdn.com 'unsafe-inline'; font-src 'self' https://maxcdn.bootstrapcdn.com 'unsafe-inline'; frame-src 'self' https://www.google.com 'unsafe-inline'; script-src 'self' https://maps.googleapis.com/maps/api/js?key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&libraries=places&callback=initAutocomplete 'unsafe-inline' ;media-src *">
错误消息:
内容安全策略指令“ script-src”的源列表包含具有无效路径的源:“ / maps / api / js?key = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&libraries = places&callback = initautocomplete”。查询组件(包括“?”)将被忽略。