Replies: 2 comments
-
Maybe you can use https://github.com/salvo-rs/salvo/blob/main/crates/extra/src/force_https.rs |
Beta Was this translation helpful? Give feedback.
0 replies
-
Yes it works! Thank you! You have developed an excellent framework, it is as convenient and concise as possible, but the only source of information on working with it is its documentation, which is not yet completely complete, so a number of questions arise in solving typical tasks when mastering it, thank you for answering questions right away! I believe in the success of Salvo!
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I can't figure out how to redirect to https correctly! it turned out just like that, but it’s not quite right, because you can change the scheme, but it didn’t work out for me
`#[handler]
async fn redir(req: &mut Request) -> Redirect{
let a = req.scheme_mut();
*a = Scheme::HTTPS;
println!("{}",req.scheme()); //print "https"
println!("{}",req.uri()); // print "http://domain.com/"
let c: String = req.uri().to_string().replace("http", "https"); // This work, but its not good
Redirect::other(c)
}
#[tokio::main]
async fn main() {
tracing_subscriber::fmt().init();
Beta Was this translation helpful? Give feedback.
All reactions