File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -173,19 +173,19 @@ export const githubMediaResponse = Effect.fn("GitHubMediaFetch.githubMediaRespon
173173 headers,
174174 } ) ;
175175 }
176- for ( const name of FORWARDED_RESPONSE_HEADERS ) {
177- const value = response . headers [ name ] ;
178- if ( value !== undefined ) headers [ name ] = value ;
179- }
180176 // Only pictures and recordings leave this origin, and never on GitHub's word alone: the raw
181177 // host labels every committed binary `application/octet-stream`, so the name decides those.
182- const upstreamType = headers [ "content-type" ] ?. split ( ";" , 1 ) [ 0 ] ?. trim ( ) . toLowerCase ( ) ?? "" ;
178+ const upstreamType = response . headers [ "content-type" ] ?. split ( ";" , 1 ) [ 0 ] ?. trim ( ) . toLowerCase ( ) ?? "" ;
183179 const contentType = MEDIA_CONTENT_TYPE_PATTERN . test ( upstreamType )
184180 ? upstreamType
185181 : ( Mime . getType ( githubMediaFileName ( asset . url ) ) ?. toLowerCase ( ) ?? "" ) ;
186182 if ( ! MEDIA_CONTENT_TYPE_PATTERN . test ( contentType ) ) {
187183 return HttpServerResponse . empty ( { status : 415 , headers } ) ;
188184 }
185+ for ( const name of FORWARDED_RESPONSE_HEADERS ) {
186+ const value = response . headers [ name ] ;
187+ if ( value !== undefined ) headers [ name ] = value ;
188+ }
189189 headers [ "content-type" ] = contentType ;
190190 if ( contentType === SVG_CONTENT_TYPE ) {
191191 headers [ "content-security-policy" ] = SVG_CONTENT_SECURITY_POLICY ;
Original file line number Diff line number Diff line change @@ -1641,7 +1641,9 @@ export const ChatMarkdownAssetImage = memo(function ChatMarkdownAssetImage(props
16411641 kind : props . kind ?? "image" ,
16421642 name : props . alt || ( props . kind ?? "image" ) ,
16431643 src,
1644- asset : { environmentId : props . environmentId , resource } ,
1644+ ...( fallbackSrc === undefined
1645+ ? { asset : { environmentId : props . environmentId , resource } }
1646+ : { } ) ,
16451647 ...( reference ? { reference } : { } ) ,
16461648 ...( relativePath && ( resource . _tag === "media-file" || resource . _tag === "workspace-file" )
16471649 ? {
You can’t perform that action at this time.
0 commit comments