Skip to content

Instantly share code, notes, and snippets.

@kfuchs
Created March 6, 2014 13:29
Show Gist options
  • Save kfuchs/9389692 to your computer and use it in GitHub Desktop.
Save kfuchs/9389692 to your computer and use it in GitHub Desktop.
Settings for NelmioCORSBundle that ended hours of misery
# app/config/config.yml
# The part that saved me was:
# 1: My quotes didn't wrap every header type in allow_headers
# 2: hosts: has to be set to the domain making the request.
nelmio_cors:
defaults:
allow_credentials: true
allow_origin: ['*']
allow_headers: ['Authorization', 'Origin', 'Content-Type', 'Accept', 'X-Requested-With']
allow_methods: ['GET', 'POST', 'PUT', 'PATCH', 'OPTIONS']
#allow_methods: []
expose_headers: ['*']
max_age: 0
hosts: ['domain.com']
paths:
'^/':
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment