Skip to content

IfNoneMatch::decode() returns and empty ETag even if the iterator passed to it is empty #204

@devashishdxt

Description

@devashishdxt
use headers::{IfNoneMatch, Header};

#[test]
fn test_empty_if_none_match() {
    let mut iter = std::iter::empty();
    let if_none_match = IfNoneMatch::decode(&mut iter);

    assert!(if_none_match.is_err()); // This assert fails. `decode` returns `Ok(IfNoneMatch(Tags("")))`
}

This means that even if there's no IfNoneMatch header in the request, this'll still report it as present.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions