File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -82,10 +82,15 @@ async function logProxy(request: Request): Promise<Response> {
82
82
83
83
async function pureProxy ( request : Request , pathname : string ) : Promise < Response > {
84
84
const response = await fetch ( `https://logfire-api.pydantic.dev${ pathname } ` , request )
85
- if ( ! response . headers . has ( 'Access-Control-Allow-Origin' ) ) {
86
- response . headers . set ( 'Access-Control-Allow-Origin' , allowOrigin ( request ) )
85
+ const headers = new Headers ( response . headers )
86
+ if ( ! headers . has ( 'Access-Control-Allow-Origin' ) ) {
87
+ headers . set ( 'Access-Control-Allow-Origin' , allowOrigin ( request ) )
87
88
}
88
- return response
89
+ return new Response ( response . body , {
90
+ status : response . status ,
91
+ statusText : response . statusText ,
92
+ headers,
93
+ } )
89
94
}
90
95
91
96
const preflight = ( request : Request ) =>
You can’t perform that action at this time.
0 commit comments