简体   繁体   中英

How to restrict json files that are stored under wwwroot folder to view from Web Browser

I have a " client-styles.css " in my wwwroot / client_folder folder. When I run my project in localhost and give that css file path in the browser its showing the entire css file in the web browser. ( localhost:5000/client_folder/client-styles.css ).

In the same way I have a folder also contains json files which contains sensitive information and those are also showing if we give the path to those Json files ( localhost:5000/client_folder/client-secrets.json ) in the browser. Is there any way restricting some files to view from web browser.

Thanks

Based on your last comment above:

It's perfectly acceptable to store css and javascript files in wwwroot. However, do not store anything secret there. Storing secrets like connectionstrings are best in EnvironmentVariables.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM