atuttle / Taffy

:candy: The REST Web Service framework for ColdFusion and Lucee
http://taffy.io
Other
225 stars 117 forks source link

Split 'allowCrossDomain' into 2 settings! #384

Open charlesr1971 opened 5 years ago

charlesr1971 commented 5 years ago

Adam. I really love Taffy. It is a great REST framework. There is just one small change, that comes to mind.

In the framework config:

allowCrossDomain: boolean | string

Should be just set to a boolean data type. The string option should be removed

Then you could have another config key called:

crossDomains: string

This value would replace the string data type of 'allowCrossDomain'.

The point behind this, is that some developers might want to turn off the 3 headers that 'allowCrossDomain' automatically creates, but, at the same time, they might want to add their own CORS domain values.

Anyway, just a thought?

atuttle commented 3 years ago

Wouldn't having some hostnames allowed imply that cross-domain access should be enabled? I can understand the request from a data-type perspective (a variable that's sometimes a bool and sometimes a string can be confusing) but other than that, doesn't combining it save us a configuration setting that would be implied otherwise?