Skip to content

Commit 67fc385

Browse files
authored
Merge pull request #1808 from nodeSolidServer/fix/issue#1807
replace res.set()
2 parents 5dc908c + 887a94e commit 67fc385

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/handlers/get.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ async function handler (req, res, next) {
101101
RDFs.includes(contentType) && !isHtmlResource && !ldp.suppressDataBrowser)
102102

103103
if (useDataBrowser) {
104-
res.set('Content-Type', 'text/html')
104+
res.setHeader('Content-Type', 'text/html')
105105
const defaultDataBrowser = require.resolve('mashlib/dist/databrowser.html')
106106
const dataBrowserPath = ldp.dataBrowserPath === 'default' ? defaultDataBrowser : ldp.dataBrowserPath
107107
debug(' sending data browser file: ' + dataBrowserPath)
@@ -118,23 +118,25 @@ async function handler (req, res, next) {
118118
let headers = {
119119
'Content-Type': contentType
120120
}
121+
121122
if (contentRange) {
122123
headers = {
123124
...headers,
124125
'Content-Range': contentRange,
125126
'Accept-Ranges': 'bytes',
126127
'Content-Length': chunksize
127128
}
128-
res.statusCode = 206
129+
res.status(206)
129130
}
130131

131-
if (prep & isRdf(contentType) && !res.sendEvents({
132+
if (prep && isRdf(contentType) && !res.sendEvents({
132133
config: { prep: prepConfig },
133134
body: stream,
134135
isBodyStream: true,
135136
headers
136137
})) return
137-
res.set(headers)
138+
139+
res.writeHead(res.statusCode, headers) // res.set sneds 'charset'
138140
return stream.pipe(res)
139141
}
140142

0 commit comments

Comments
 (0)