You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
903 B

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Threading.Tasks;
  5. using Microsoft.AspNetCore.Mvc;
  6. using Microsoft.AspNetCore.Mvc.Filters;
  7. using Microsoft.Extensions.Logging;
  8. using Microsoft.AspNetCore.Authorization;
  9. namespace Shentun.WebPeis.WebApiServer
  10. {
  11. //public class RequireHttpsAttribute : AuthorizationFilterAttribute
  12. //{
  13. // public override void OnAuthorization(HttpActionContext actionContext)
  14. // {
  15. // if (actionContext.Request.RequestUri.Scheme != Uri.UriSchemeHttps)
  16. // {
  17. // actionContext.Response = new HttpResponseMessage(System.Net.HttpStatusCode.Forbidden)
  18. // {
  19. // ReasonPhrase = "HTTPS Required"
  20. // };
  21. // }
  22. // else
  23. // {
  24. // base.OnAuthorization(actionContext);
  25. // }
  26. // }
  27. //}
  28. }