Have found the below CORS config in the torch serve documentation.
Ref: Advanced configuration — PyTorch/Serve master documentation
# cors_allowed_origin is required to enable CORS, use '*' or your domain name
cors_allowed_origin=https://yourdomain.com
# required if you want to use preflight request
cors_allowed_methods=GET, POST, PUT, OPTIONS
# required if the request has an Access-Control-Request-Headers header
cors_allowed_headers=X-Custom-Header

Can you please confirm if I am using the right syntax? Trying to generatte a prediction using fetchAPI  and my request header contains a custom “X-Custom-Header”.
(‘X-Custom-Header’, ‘ProcessThis’);
To allow any domains the cors_allowed_origion should be:
cors_allowed_origin=*
cors_allowed_headers=X-Custom-Header