File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed
Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import { AuthResult, DEFAULT_AUTH_ERROR } from "../../auth/types.js";
2020import { logger } from "../../core/Logger.js" ;
2121import { getRequestHeader , setResponseHeaders } from "../../utils/headers.js" ;
2222import { DEFAULT_CORS_CONFIG } from "../sse/types.js" ;
23+ import { CORSConfig } from "../sse/types.js" ;
2324
2425function isRequest ( msg : JsonRpcMessage ) : msg is JsonRpcRequest {
2526 return msg &&
@@ -79,7 +80,7 @@ export class HttpStreamTransport extends AbstractTransport {
7980 ...config ,
8081 session : { ...DEFAULT_HTTP_STREAM_CONFIG . session , ...config . session } ,
8182 resumability : { ...DEFAULT_HTTP_STREAM_CONFIG . resumability , ...config . resumability } ,
82- cors : { ...DEFAULT_CORS_CONFIG , ...( config . cors || { } ) } as Required < NonNullable < HttpStreamTransportConfig [ 'cors' ] > > ,
83+ cors : { ...DEFAULT_CORS_CONFIG , ...( config . cors || { } ) } as Required < NonNullable < CORSConfig > > ,
8384 auth : config . auth ?? DEFAULT_HTTP_STREAM_CONFIG . auth ,
8485 headers : config . headers ?? DEFAULT_HTTP_STREAM_CONFIG . headers ,
8586 enableGetSse : config . enableGetSse ?? DEFAULT_HTTP_STREAM_CONFIG . enableGetSse ,
Original file line number Diff line number Diff line change @@ -99,13 +99,7 @@ export interface HttpStreamTransportConfig {
9999 /**
100100 * CORS configuration
101101 */
102- cors ?: {
103- allowOrigin ?: string ;
104- allowMethods ?: string ;
105- allowHeaders ?: string ;
106- exposeHeaders ?: string ;
107- maxAge ?: string ;
108- } ;
102+ cors ?: CORSConfig ;
109103
110104 /**
111105 * Authentication configuration
@@ -158,7 +152,7 @@ export interface HttpStreamTransportConfig {
158152 * Internal configuration type with required fields
159153 */
160154export type HttpStreamTransportConfigInternal = Required < Omit < HttpStreamTransportConfig , 'headers' | 'auth' | 'cors' | 'session' | 'resumability' > > & {
161- cors : Required < NonNullable < HttpStreamTransportConfig [ 'cors' ] > > ;
155+ cors : Required < NonNullable < CORSConfig > > ;
162156 session : Required < NonNullable < HttpStreamTransportConfig [ 'session' ] > > ;
163157 resumability : Required < NonNullable < HttpStreamTransportConfig [ 'resumability' ] > > ;
164158 headers ?: Record < string , string > ;
You can’t perform that action at this time.
0 commit comments