1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-31 17:07:01 +02:00

propogate app config with http request; add tests for url_for

This commit is contained in:
Nikolay Kim
2019-03-09 14:06:24 -08:00
parent c0ce7f0bae
commit 54678308d0
18 changed files with 397 additions and 215 deletions

View File

@@ -64,14 +64,13 @@ impl ResourceMap {
if self.patterns_for(name, &mut path, &mut elements)?.is_some() {
if path.starts_with('/') {
// let conn = req.connection_info();
// Ok(Url::parse(&format!(
// "{}://{}{}",
// conn.scheme(),
// conn.host(),
// path
// ))?)
unimplemented!()
let conn = req.connection_info();
Ok(Url::parse(&format!(
"{}://{}{}",
conn.scheme(),
conn.host(),
path
))?)
} else {
Ok(Url::parse(&path)?)
}