Cannot disable requirehttps on asp.net 5 MVC 6

I have an asp.net 5 MVC 6 site that I am working on. I turned on HTTPS like this:

services.AddMvc(options =>
{
    options.Filters.Add(new RequireHttpsAttribute());
});

He did a great job and I worked a bit on this. Today I need to disable it, so I commented on the parameter filter, but it still requires HTTPS.

I did not use the [RequireHttps] attribute on the controllers or actions themselves.

I went into the properties and unchecked "Enable SSL" and inserted the http-url into the "Launch URL" field.

I disabled IIS Express and restarted the site. It doesn't seem to matter what I'm doing, it keeps trying to redirect to HTTPS.

Is it possible that IIS Express or Kestral cached something that I need to delete? Anyone have any suggestions on what else could make him use HTTPS?

+4
1

RequireHttpsAttribute (301) :

// redirect to HTTPS version of page
filterContext.Result = new RedirectResult(newUrl, permanent: true);

, URL-, http://localhost:62058/, :

301 (Moved permanently)
Location: https://localhost:62058/

301, , :

URI URIs. Request-URI , , . cacheable, .

URI "" . , URI ().

RequireHttps :

Obtaining https redirect caching

, , RequireHttps, - !

+9

Source: https://habr.com/ru/post/1621342/


All Articles