Skip to content

Commit b0be8bd

Browse files
committed
feat: include DELETE method for CORS
1 parent ea774ce commit b0be8bd

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

crates/apollo-mcp-server/src/cors.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ impl Default for CorsConfig {
4747
match_origins: Vec::new(),
4848
allow_any_origin: false,
4949
allow_credentials: false,
50-
allow_methods: vec!["GET".to_string(), "POST".to_string()],
50+
allow_methods: vec![
51+
"GET".to_string(),
52+
"POST".to_string(),
53+
"DELETE".to_string(), // Clients that no longer need a particular session SHOULD send an HTTP DELETE to explicitly terminate the session
54+
],
5155
allow_headers: vec![
5256
"content-type".to_string(),
5357
"mcp-protocol-version".to_string(), // https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#protocol-version-header
@@ -223,7 +227,7 @@ mod tests {
223227
assert!(!config.allow_credentials);
224228
assert_eq!(
225229
config.allow_methods,
226-
vec!["GET".to_string(), "POST".to_string()]
230+
vec!["GET".to_string(), "POST".to_string(), "DELETE".to_string()]
227231
);
228232
assert_eq!(
229233
config.allow_headers,

crates/apollo-mcp-server/src/runtime.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ mod test {
153153
allow_methods: [
154154
"GET",
155155
"POST",
156+
"DELETE",
156157
],
157158
allow_headers: [
158159
"content-type",

0 commit comments

Comments
 (0)