CORS: Support regular expressions for origin to match against

This commit adds regular expression support for the allow-origin
header depending on the value of the request `Origin` header.

Relates #5601
Closes #6891
can this be corsSettings.startsWith / corsSettings.endsWith instead of direct char access?