Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support url generation for mounted routers #133

Closed
wants to merge 1 commit into from

Conversation

flosse
Copy link

@flosse flosse commented Nov 25, 2016

This is a quick attempt to solve #132 .

@flosse flosse force-pushed the url-for-with-mount branch 3 times, most recently from cbe367b to c696855 Compare November 25, 2016 16:07
@flosse flosse force-pushed the url-for-with-mount branch from c696855 to 3a3d6ad Compare November 25, 2016 16:13
@sapsan4eg
Copy link
Contributor

Hi could you please add to the method https://github.com/iron/router/blob/master/src/router.rs#L185 same behavior? This related problem with crate mount and redirect slash. There issue #128

@sapsan4eg
Copy link
Contributor

Unfortunately this test won't passed

#[test]
    fn test_with_mount_second() {
        let mut url = "http://localhost/mounted/foo/bar".parse().unwrap();
        url_for_impl(&mut url, "/foo/:user", {
            let mut rv = HashMap::new();
            rv.insert("user".into(), "bam".into());
            rv
        });
        assert_eq!(url.to_string(), "http://localhost/mounted/foo/bam");
    } 

this is not a complete solution

@flosse
Copy link
Author

flosse commented Dec 1, 2016

this is not a complete solution

Ok, so I'll close this PR until s.o. found a better solution :)

@flosse flosse closed this Dec 1, 2016
@Hoverbear
Copy link

@flosse Thanks for much for your contribution anyways. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants