PHP和Google应用程序引擎上的CORS

PHP和Google应用程序引擎上的CORS,php,google-app-engine,Php,Google App Engine,在过去的一天里,我一直在开发应用程序引擎,目前我只专注于一件事 科尔斯 我在PHP文件的顶部包括了以下内容 header('Access-Control-Allow-Origin: *'); header('Header always set Access-Control-Allow-Credentials: true'); header('Header add Access-Control-Allow-Headers "origin, x-requested-with, content-typ

在过去的一天里,我一直在开发应用程序引擎,目前我只专注于一件事

科尔斯

我在PHP文件的顶部包括了以下内容

header('Access-Control-Allow-Origin: *');
header('Header always set Access-Control-Allow-Credentials: true');
header('Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type"');
header('Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"');
在我的app.yaml文件中,我有以下内容

application: app
version: 1
runtime: php55
api_version: 1
module: default

handlers:
- url: /
  script: index.php

- url: /ip
  script: /ip/index.php

- url: /user
  script: /user/index.php

- url: /user/auth
  script: /user/auth/index.php

- url: /user/check
  script: /user/check/index.php

- url: /user/dash
  script: /user/dash/index.php

- url: /user/forget
  script: /user/forget/index.php

- url: /user/generate
  script: /user/generate/index.php

- url: /user/link
  script: /user/link/index.php

- url: /user/maps
  script: /user/maps/index.php

- url: /user/profile
  script: /user/profile/index.php

- url: /user/register
  script: /user/register/index.php

- url: /user/reset
  script: /user/reset/index.php

- url: /user/signin
  script: /user/signin/index.php

- url: /user/signout
  script: /user/signout/index.php

- url: /user/status
  script: /user/status/index.php

- url: /user/subscription
  script: /user/subscription/index.php

- url: /user/unlink
  script: /user/unlink/index.php

- url: /user/visible
  script: /user/visible/index.php

- url: /user/alert
  script: /user/alert/index.php
我在另一个域上使用端点,并且只返回前两个值,其他的返回值与此类似

XMLHttpRequest cannot load http://domaincom/user/status. A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin' header when the credentials flag is true. Origin 'http://localhost:9000' is therefore not allowed access.
我不确定如何解决这个问题,因为似乎只有嵌套端点失败

header('Access-Control-Allow-Origin: http://localhost:9000');
header('Access-Control-Allow-Credentials: true');
header('Access-Control-Allow-Headers "origin, x-requested-with, content-type"');
header('Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"');

以上解决了问题

我只使用第一个标题,请尝试删除其他标题。错误消息表明它与第二个冲突header@marcadian尝试了这个,仍然是同样的错误