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

Can't request static file twice #280

Closed
Roba1993 opened this issue Apr 28, 2017 · 1 comment
Closed

Can't request static file twice #280

Roba1993 opened this issue Apr 28, 2017 · 1 comment
Labels
duplicate This issue or pull request already exists no bug The reported bug was confirmed nonexistent

Comments

@Roba1993
Copy link

Roba1993 commented Apr 28, 2017

Hi,

I've created the following two static file functions:

#[get("/")]
fn index() -> io::Result<NamedFile> {
    NamedFile::open("../ui/web/index.html")
}

#[get("/<file>")]
fn files(file: String) -> Option<NamedFile> {
    NamedFile::open(Path::new("../ui/web/").join(file)).ok()
}

The first request is working, like expected. The second request (from chrome browser) didn't sent a response for 20-30 seconds.
I run this under mac os x and with cargo run

Is it a bug, or did I make a failure?

Thanks,
Robert

@SergioBenitez SergioBenitez added duplicate This issue or pull request already exists no bug The reported bug was confirmed nonexistent labels Apr 28, 2017
@SergioBenitez
Copy link
Member

Please see #191, #239, #243.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists no bug The reported bug was confirmed nonexistent
Projects
None yet
Development

No branches or pull requests

2 participants