fix(cli): Add missing content type header on compressed responses of /

This commit is contained in:
Roman Hotsiy 2019-07-29 17:18:51 +03:00 committed by GitHub
commit f7248135b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -156,7 +156,9 @@ async function serve(port: number, pathToSpec: string, options: Options = {}) {
}, },
); );
} else if (request.url === '/') { } else if (request.url === '/') {
respondWithGzip(pageHTML, request, response); respondWithGzip(pageHTML, request, response, {
'Content-Type': 'text/html',
});
} else if (request.url === '/spec.json') { } else if (request.url === '/spec.json') {
const specStr = JSON.stringify(spec, null, 2); const specStr = JSON.stringify(spec, null, 2);
respondWithGzip(specStr, request, response, { respondWithGzip(specStr, request, response, {