Skip to content

Could we get string representation for CacheControl  #146

Closed as not planned
@sadokmtir

Description

@sadokmtir

I am using this crate for dealing with headers for example Cache-Control and I find it very helpful to create headers in general with this lib. But unfortunately most of the headers Structs they do not provide a string representation so we could include the headers in the response.

Example:

           let mut res = axum::response::Response::builder();

            let cache_control_value = axum::headers::CacheControl::new()
                .with_max_age(Duration::new(10, 0))
                .with_public();
            res = res.header(CACHE_CONTROL, cache_control_value.as_str());

Something like that would be very useful not only for Cache-Control but for most headers

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