Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion crates/mako/src/dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use anyhow::{self, Result};
use colored::Colorize;
use futures::{SinkExt, StreamExt};
use get_if_addrs::get_if_addrs;
use hyper::header::CONTENT_TYPE;
use hyper::header::{ACCESS_CONTROL_ALLOW_ORIGIN, CACHE_CONTROL, CONTENT_TYPE};
use hyper::service::{make_service_fn, service_fn};
use hyper::{Body, Request, Server};
use notify_debouncer_full::new_debouncer;
Expand Down Expand Up @@ -179,6 +179,8 @@ impl DevServer {

return Ok(hyper::Response::builder()
.status(hyper::StatusCode::OK)
.header(CACHE_CONTROL, "no-cache")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that adding the Cache-Control: no-cache header does not interfere with other caching mechanisms or headers that might be required for different environments or use cases. Consider making this configurable if necessary.

.header(ACCESS_CONTROL_ALLOW_ORIGIN, "*")
.header(CONTENT_TYPE, content_type)
.body(hyper::Body::from(res))
.unwrap());
Expand Down