Added charset info to content-type header in rest api (#597)

This commit is contained in:
Cristian Balas
2022-02-17 19:53:27 +02:00
committed by GitHub
parent 7ca644599e
commit 69d09c7d75
2 changed files with 2 additions and 2 deletions
@@ -25,7 +25,7 @@ module.exports = ( app ) => {
let simpleText = req.headers.accept === 'text/plain'
res.writeHead( 200, { 'Content-Encoding': 'gzip', 'Content-Type': simpleText ? 'text/plain' : 'application/json' } )
res.writeHead( 200, { 'Content-Encoding': 'gzip', 'Content-Type': simpleText ? 'text/plain; charset=UTF-8' : 'application/json' } )
let dbStream = await getObjectsStream( { streamId: req.params.streamId, objectIds: childrenList } )
let speckleObjStream = new SpeckleObjectsStream( simpleText )
@@ -30,7 +30,7 @@ module.exports = ( app ) => {
let simpleText = req.headers.accept === 'text/plain'
res.writeHead( 200, { 'Content-Encoding': 'gzip', 'Content-Type': simpleText ? 'text/plain' : 'application/json' } )
res.writeHead( 200, { 'Content-Encoding': 'gzip', 'Content-Type': simpleText ? 'text/plain; charset=UTF-8' : 'application/json' } )
let dbStream = await getObjectChildrenStream( { streamId: req.params.streamId, objectId: req.params.objectId } )
let speckleObjStream = new SpeckleObjectsStream( simpleText )