File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -98,10 +98,19 @@ function r2MetadataToHeaders(
9898) : HttpResponseHeaders {
9999 const { httpMetadata } = object ;
100100
101+ let contentType : string ;
102+ if ( object . httpMetadata ?. contentType ) {
103+ contentType = object . httpMetadata . contentType ;
104+ } else {
105+ // Serve .tab files as text files
106+ contentType = object . key . endsWith ( '.tab' )
107+ ? 'text/plain'
108+ : 'application/octet-stream' ;
109+ }
110+
101111 return {
102112 etag : object . httpEtag ,
103- 'content-type' :
104- object . httpMetadata ?. contentType ?? 'application/octet-stream' ,
113+ 'content-type' : contentType ,
105114 'accept-range' : 'bytes' ,
106115 // https://github.com/nodejs/build/blob/e3df25d6a23f033db317a53ab1e904c953ba1f00/ansible/www-standalone/resources/config/nodejs.org?plain=1#L194-L196
107116 'access-control-allow-origin' : object . key . endsWith ( '.json' ) ? '*' : '' ,
You can’t perform that action at this time.
0 commit comments