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

Router cannot match while the HTTP Path is AbsoluteUri #440

Open
colorhook opened this issue Jul 14, 2019 · 0 comments
Open

Router cannot match while the HTTP Path is AbsoluteUri #440

colorhook opened this issue Jul 14, 2019 · 0 comments

Comments

@colorhook
Copy link

Add middleware for every request

server.utilize(middleware! { | request |
    println!("logging request from middleware! macro: {:?}", request.origin.uri);
});

Handle a route

server.get('/',  middleware!("Yes, got it!");

start server

let _ = server.listen("127.0.0.1:8080");

visit http://localhost:8080, get corrent response from server, and terminal display:

logging request from middleware! macro: AbsolutePath("/")

But browser got 404 while visiting with a domain(by SwitchyOmega chrome plugin), the HTTP request header begin with:

GET http://xxx.com/ HTTP/1.1

And log middleware output the message:

logging request from middleware! macro: AbsoluteUri("http://xxx.com/")
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

No branches or pull requests

1 participant