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

'//' path produces async-h1 error, probably from being treated as a protocol-relative URL #733

Closed
etherealvisage opened this issue Nov 2, 2020 · 1 comment

Comments

@etherealvisage
Copy link

Consider the following minimal tide server:

#[async_std::main]
async fn main() -> Result<(), std::io::Error> {
    tide::log::start();
    tide::new().listen("127.0.0.1:2000").await?;
    Ok(())
}

If we then run curl against it:

~$ curl localhost:2000// 
curl: (52) Empty reply from server

The logging output contains:

tide::listener::tcp_listener async-h1 error
    error empty host

After guessing from the empty host bit that it's treating "//" as a protocol-relative URL; and we can confirm this by curling localhost:2000//test/a/b/c: the logging output says:

tide::log::middleware <-- Request received
    method GET
    path /a/b/c

I haven't gone digging for where this might be happening, but thought I'd open this issue in case it's a quick fix for someone else :-)

@Fishrock123
Copy link
Member

Should be fixed in the next `async-h1 release

@jbr jbr closed this as completed Feb 11, 2021
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

3 participants