I mostly use the default server config using cargo run --release (only changed port to 8080 and commented out the SSL part because binding to ports below 1024 requires root privileges).
Then, I use netcat to manually do a HTTP request (because curl normalizes URLs which can affect the demonstration):
$ nc 127.0.0.1 8080
GET /../Cargo.toml HTTP/1.1
Host: example.com
The server will respond with the contents of the Cargo.toml, which is outside the "assets" directory which is configured in the Cbltfile and as such should not be accessible.
I mostly use the default server config using
cargo run --release
(only changed port to 8080 and commented out the SSL part because binding to ports below 1024 requires root privileges).Then, I use netcat to manually do a HTTP request (because curl normalizes URLs which can affect the demonstration):
The server will respond with the contents of the Cargo.toml, which is outside the "assets" directory which is configured in the Cbltfile and as such should not be accessible.