what is use hsts in .net core 1

what is use hsts in .net core

This is a continuation to the previous article on Enforcing HTTPS.

While redirecting all non-secure requests to secure URLs is good, 
a man-in-the-middle can still hijack the connection before the 
redirect. And if the user types the address as company.com in 
the address bar, it will access the site insecurely every single 
time.

Here is what the above code is Doing:
1. If the request is secure, it will return the response as is.
2. If the request is not secure, it will redirect to the secure URL.
3. If the request is not secure and the URL is not the secure URL,
it will redirect to the secure URL.

Similar Posts