Akash Babu
Akash Babu

Reputation: 247

Prevent URL editing by users to restrict access to server's resources

I'm using node.js and express to serve html files which uses SSL encryption. But i noticed that users can change the url ie. if url is https://localhost/index,html, to https://localhost/anyother.html.How do i disable editing of url by users so that they cannot access any other html files of my server.

Upvotes: 1

Views: 1044

Answers (1)

Quentin
Quentin

Reputation: 944076

You can't.

Clients can ask for whatever they like.

If you want to limit who the server will give the files to, use an authentication / authorization system. Identify the user (e.g. with a password) and then decide if you want to respond with the file or a 403 Forbidden.

Upvotes: 3

Related Questions