Skip to content

refactor: remove default ACCESS_CONTROL_ALLOW_ORIGIN and `CACHE_CON…#134

Merged
ruslanti merged 1 commit into
mainfrom
ref/remove-default-cache-headers
May 11, 2026
Merged

refactor: remove default ACCESS_CONTROL_ALLOW_ORIGIN and `CACHE_CON…#134
ruslanti merged 1 commit into
mainfrom
ref/remove-default-cache-headers

Conversation

@ruslanti
Copy link
Copy Markdown
Collaborator

…TROL` headers for cleaner response handling

  • Eliminated setting default ACCESS_CONTROL_ALLOW_ORIGIN and CACHE_CONTROL headers in app_res_headers function.
  • Updated tests to reflect the new header count and removed assertions for these headers.

…TROL` headers for cleaner response handling

- Eliminated setting default `ACCESS_CONTROL_ALLOW_ORIGIN` and `CACHE_CONTROL` headers in `app_res_headers` function.
- Updated tests to reflect the new header count and removed assertions for these headers.
@ruslanti ruslanti self-assigned this May 11, 2026
Copilot AI review requested due to automatic review settings May 11, 2026 10:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors http-service response header handling by removing two previously hard-coded default headers (Access-Control-Allow-Origin: * and Cache-Control: no-store) so that responses only include headers explicitly configured per app.

Changes:

  • Removed default ACCESS_CONTROL_ALLOW_ORIGIN and CACHE_CONTROL headers from app_res_headers.
  • Updated HTTP executor tests to expect fewer response headers after defaults were removed.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
crates/http-service/src/lib.rs Removes the global default response headers from app_res_headers, changing default response header behavior.
crates/http-service/src/executor/http.rs Updates tests to reflect the new (reduced) header set returned by handle_request.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -615,11 +614,6 @@ fn app_name_from_request(req: &hyper::Request<impl Body>) -> Result<AppName> {

fn app_res_headers(app_cfg: App) -> HeaderMap {
let mut headers = HeaderMap::new();
HeaderValue::from_str("*").unwrap(),
);
headers.append(CACHE_CONTROL, HeaderValue::from_str("no-store").unwrap());
/* if specified, add/remove/overwrite response headers */
@ruslanti ruslanti merged commit b11786b into main May 11, 2026
7 of 10 checks passed
@ruslanti ruslanti deleted the ref/remove-default-cache-headers branch May 11, 2026 11:30
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.

3 participants