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
This test checks for the manually set value, can we have another test that checks the behavior for the default value? I mean it should be a simple copy of this one I guess no?