dropWizard
dropWizard

Reputation: 3538

Adding Acces-Control-Allow-Origin to app.yml

I'm following these instructions from Google App Engine docs :

https://cloud.google.com/appengine/docs/python/config/appref

If you search for CORS, you'll see the example I am trying to copy.

My app.yaml file looks like:

runtime: python27
api_version: 1
threadsafe: true

handlers:
- url: /.*
  script: main.app
  http_headers: Access-Control-Allow-Origin: *

libraries:
- name: ssl
  version: latest

However when I go to update it I get this error:

appcfg.py: error: Error parsing ./app.yaml: Unable to assign value 'Access-Control-Allow-Origin' to attribute 'http_headers':
Value 'Access-Control-Allow-Origin' for http_headers is not of the expected type HttpHeadersDict

Why am I getting this error? What am I doing differently than the docs?

Upvotes: 1

Views: 6382

Answers (1)

Jeffrey Godwyll
Jeffrey Godwyll

Reputation: 3893

Unfortunately that's not valid yaml.

You have an indentation problem. Also you have to quote the *. Should be:

handlers:
- url: /.*
  script: main.app
  http_headers: 
    Access-Control-Allow-Origin: "*"

Upvotes: 6

Related Questions