Skip to content
This repository was archived by the owner on Oct 22, 2025. It is now read-only.

Commit 1a0c27c

Browse files
committed
refactor: rename ALL_PUBLIC_HEADERS to ALLOWED_PUBLIC_HEADERS (#1026)
1 parent 8f13173 commit 1a0c27c

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

packages/core/src/actor/mod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
} from "./config";
77
import { ActorDefinition } from "./definition";
88

9-
109
export function actor<
1110
S,
1211
CP,
@@ -43,3 +42,4 @@ export type {
4342
ActorContextOf,
4443
ActionContextOf,
4544
} from "./definition";
45+
export { ALLOWED_PUBLIC_HEADERS} from "./router-endpoints";

packages/core/src/actor/router-endpoints.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,9 @@ export const HEADER_CONN_TOKEN = "X-RivetKit-Conn-Token";
470470
*
471471
* Used for CORS.
472472
**/
473-
export const ALL_PUBLIC_HEADERS = [
473+
export const ALLOWED_PUBLIC_HEADERS = [
474+
"Content-Type",
475+
"User-Agent",
474476
HEADER_ACTOR_QUERY,
475477
HEADER_ENCODING,
476478
HEADER_CONN_PARAMS,

packages/core/src/manager/router.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { Transport } from "@/actor/protocol/message/mod";
55
import type { ToClient } from "@/actor/protocol/message/to-client";
66
import { type Encoding, serialize } from "@/actor/protocol/serde";
77
import {
8-
ALL_PUBLIC_HEADERS,
8+
ALLOWED_PUBLIC_HEADERS,
99
HEADER_ACTOR_ID,
1010
HEADER_ACTOR_QUERY,
1111
HEADER_AUTH_DATA,
@@ -137,7 +137,7 @@ export function createManagerRouter(
137137
...corsConfig,
138138
allowHeaders: [
139139
...(corsConfig?.allowHeaders ?? []),
140-
...ALL_PUBLIC_HEADERS,
140+
...ALLOWED_PUBLIC_HEADERS,
141141
"Content-Type",
142142
"User-Agent",
143143
],

0 commit comments

Comments
 (0)