Add MarketDataServer

This commit is contained in:
2025-04-06 18:28:24 -04:00
parent 954c45ee81
commit ac69b4a994
17 changed files with 961 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net.Http;
namespace MarketDataServer.Handlers
{
public class CustomHeaderHandler : DelegatingHandler
{
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, System.Threading.CancellationToken cancellationToken)
{
return base.SendAsync(request, cancellationToken)
.ContinueWith((task) =>
{
HttpResponseMessage response = task.Result;
response.Headers.Add("Access-Control-Allow-Origin", "*");
//response.Headers.Add("Access-Control-Allow-Credentials", "true");
//response.Headers.Add("Access-Control-Allow-Methods", "OPTIONS, GET, POST");
//response.Headers.Add("Access-Control-Allow-Headers", "Content-Type, Depth, User-Agent, X-File-Size, X-Requested-With, If-Modified-Since, X-File-Name, Cache-Control");
return response;
});
}
}
}