In my project, HSTS is enabled. So if someone is tryig to use the site using the HTTP then it redirects to HTTPS.
After the Security scan, it is reported that ttf, woff and woff2 files are ignoring the HSTS.
So if i will access: http://example.com/backend/web/lib/roboto/Roboto-Black.ttf
Then it will download that file instead of redirecting to HTTPS one in Address Bar of Browser.
Then i have checked the network logs using the developer tools:
1) When i am accessing the font file with HTTP then below is the result:
So it has 301 Mover Permanently status but it downloads the font file over http.
2) Then it redirects to the font file with HTTPS on Developer tools but URL is not changing in Address Bar of browser.
So what should i do to fix this issue? Should the HSTS prevent the file downloading over HTTP. Its working fine for files which can be display in Browser like HTML,CSS,JS, Images etc. But not the one which is not Viewable in browser.