Skip to content

Fix Cache-Control header #1811

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

Merged
merged 1 commit into from
Apr 21, 2023
Merged

Conversation

jdno
Copy link
Member

@jdno jdno commented Apr 21, 2023

No description provided.

@jdno jdno requested a review from a team as a code owner April 21, 2023 10:47
@senekor
Copy link
Contributor

senekor commented Apr 21, 2023

Thanks! I borked this in the rocket v5 migration. I'm wondering if something like this would be more idiomatic:

use rocket::http::{hyper, Header};

header: Header::new(
    hyper::header::CACHE_CONTROL.as_str(),
    format!("max-age={max_age}"),
),

So we aren't hard coding the string at all.

@jdno jdno force-pushed the fix-cache-control branch from 5db80cb to f7c3f1d Compare April 21, 2023 13:11
@jdno
Copy link
Member Author

jdno commented Apr 21, 2023

No worries about the migration, that can happen. 🙂 Sorry from my side for not writing a proper pull request description. 😅

I like the proposed code, much cleaner to rely on hyper than to hard-code the header name. Works well. 👍

@pietroalbini pietroalbini merged commit c50cd2f into rust-lang:master Apr 21, 2023
@pietroalbini pietroalbini mentioned this pull request Apr 21, 2023
@jdno jdno deleted the fix-cache-control branch April 24, 2023 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants