mgr/dashboard: allow cross origin when the url is set
Allow CORS when the cross_origin_url is set in the config opt.
you have to update the cross_origin_url setting with the url of the
requesting entity.
The request needs to have the header `Access-Control-Allow-Origin`
with the origin URL
The url can be set using this command
`ceph config set mgr mgr/dashboard/cross_origin_url
http://localhost:4200`
multiple urls can be set as
`ceph config set mgr mgr/dashboard/cross_origin_url
http://localhost:4200,http://localhost:4201`
If multiple url is provided in the configuration option, then whatever
url is there in the Access-Control-Allow-Origin request header will be
allowed for CORS
Once the URL is set you have to restart the dashboard module to restart
the cherrypy server with the new CORS policies
Fixes: https://tracker.ceph.com/issues/58086
Signed-off-by: Nizamudeen A <nia@redhat.com>
(cherry picked from commit
1cf017bde492d3058d05b4375c1168cec9002afd)