Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class SignalrQsHeaderMiddleware
- {
- private readonly RequestDelegate _next;
- public SignalrQsHeaderMiddleware(RequestDelegate next)
- {
- this._next = next;
- }
- public async Task Invoke(HttpContext context)
- {
- /*
- if (context.Request.Path.Value.Contains("/restaurantHub"))
- {
- var qsHeader = context.Request.Query["access_token"].ToString();
- if (!qsHeader.IsNullOrEmpty())
- {
- context.Request.Headers.Add("Authorization",qsHeader);
- }
- }*/
- await _next.Invoke(context);
- }
- }
- public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
- {
- //Other services.
- app.UseMiddleware<SignalrQsHeaderMiddleware>();//<-- added here
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement