geo302 0.2.2

A simple geoIP-based redirect proxy
Documentation
1
2
3
4
5
6
7
8
9
10
use hyper::http::{Error, Uri};

pub fn compose_uri(base_uri: &Uri, path: &str) -> Result<Uri, Error> {
    let new_path = [base_uri.path(), path].concat();
    Uri::builder()
        .scheme(base_uri.scheme().unwrap().clone())
        .authority(base_uri.authority().unwrap().clone())
        .path_and_query(new_path)
        .build()
}