rustironrust-warpurl-fragment

Show anchor/fragment in Rust Iron framework?


I'm building a tool around an oauth implicit flow, which means that I eventually need to pull the access token from some URL in a request.

I'm trying to build with Iron (I've also looked at Warp), but it looks like anchor tags are stripped in the request handler?

Here's a very basic example of what I've tried -

use iron::prelude::*;

fn hello_world(req: &mut Request) -> IronResult<Response> {
    println!("got url: {}", req.url);
    Ok(Response::with((iron::status::Ok, "Hello World")))
}

fn main() {
    let chain = Chain::new(hello_world);
    Iron::new(chain).http("localhost:3000").unwrap();
}

Regardless, anything after a # is removed. I've tried prepending some query parameters to it, too.

This seems to be common with a few web frameworks I've tried.

Is there a reason for this? Am I missing out something on the docs?


Solution

  • Anchors aren't sent to a server. That's the reason.

    A different oauth flow will be needed.