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

How to filter by host #133

Closed asuri0n closed 1 year ago

asuri0n commented 5 years ago

Hi, I would like to set a specific configuration for my API subdomain (api.domain.com) but I can't set it up with paths:

my actual configuration :

nelmio_cors:
  defaults:
    allow_credentials: true
    origin_regex: true
    allow_origin: ['*','*/*']
    allow_methods: ['GET', 'PUT']
    allow_headers: ['Content-Type', 'Authorization']
    max_age: 3600
  paths:
    '^/': ~

This is not working :

...
paths:
  'api\.%base_host%':

Thanks for your help

qdequippe commented 2 months ago

hi @asuri0n, did you find a way to fix your issue?