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

Real status text gets lost #497

Closed
Ms2ger opened this issue May 1, 2015 · 2 comments · Fixed by #498
Closed

Real status text gets lost #497

Ms2ger opened this issue May 1, 2015 · 2 comments · Fixed by #498
Labels
A-tests Area: tests. C-bug Category: bug. Something is wrong. This is bad!

Comments

@Ms2ger
Copy link

Ms2ger commented May 1, 2015

This is blocking the Servo rustup. Code went from

    let reason = match str::from_utf8(cursor.into_inner()) {
        Ok(s) => s.trim(),
        Err(_) => return Err(HttpStatusError)
    };

    let reason = match from_u16::<StatusCode>(code) {
        Some(status) => match status.canonical_reason() {
            Some(phrase) => {
                if phrase == reason {
                    Borrowed(phrase)
                } else {
                    Owned(reason.to_string())
                }
            }
            _ => Owned(reason.to_string())
        },
        None => return Err(HttpStatusError)
    };

to

                let code = res.code.unwrap();
                let reason = match StatusCode::from_u16(code).canonical_reason() {
                    Some(reason) => Cow::Borrowed(reason),
                    None => Cow::Owned(res.reason.unwrap().to_owned())
                };
@pyfisch
Copy link
Contributor

pyfisch commented May 1, 2015

For what is the reason phrase needed in servo?

@Ms2ger
Copy link
Author

Ms2ger commented May 1, 2015

@seanmonstar seanmonstar added C-bug Category: bug. Something is wrong. This is bad! servo A-tests Area: tests. labels May 1, 2015
seanmonstar added a commit that referenced this issue May 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tests Area: tests. C-bug Category: bug. Something is wrong. This is bad!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants