nelmio / NelmioCorsBundle

Adds CORS (Cross-Origin Resource Sharing) headers support in your Symfony application
https://symfony.com/bundles/NelmioCorsBundle/
MIT License
1.89k stars 108 forks source link

No 'Access-Control-Allow-Origin' header is present on the requested resource. #63

Closed yun548 closed 8 years ago

yun548 commented 8 years ago

My Symfony API, I used FOSRestBundle worked ok and suddently I have a CORS error on every request form my Vue.js frontend

No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://rvpfront.dev:8080' is therefore not allowed access.

My Nelmio Configuration is the following

# Nelmio Cors Bundle
nelmio_cors:
    defaults:
        allow_credentials: true
        allow_origin: []
        allow_headers: []
        allow_methods: []
        expose_headers: []
        max_age: 0
        hosts: []
    paths:
        '^/':
            allow_origin: ['*']
            allow_headers: ['origin', 'content-type', 'Authorization']
            allow_methods: ['POST', 'PUT', 'GET', 'DELETE','OPTIONS']
            max_age: 3600

I'm really confused, it worked on friday and for 3 weeks before that.

yun548 commented 8 years ago

Closed, the issue seems to be coming from something else, my code seems to be executed but always stop when Doctrine has to do something.