Skip to content

Real status text gets lost #497

Closed
@Ms2ger

Description

@Ms2ger

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())
                };

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-testsArea: tests.C-bugCategory: bug. Something is wrong. This is bad!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions