Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Commit

Permalink
fix: content type should be application/json
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Coe committed May 8, 2018
1 parent 3f6f0ce commit f18e456
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions server.js
Expand Up @@ -54,6 +54,7 @@ function CouchUrlRewriteProxy (opts) {
request(payload).pipe(res)
} else {
request(payload, function (err, response, body) {
res.header('content-type', 'application/json')
var status = 500
if (response && response.statusCode) status = response.statusCode
if (err) res.status(status).send(body)
Expand Down
1 change: 1 addition & 0 deletions test/couch-url-rewrite-proxy.js
Expand Up @@ -103,6 +103,7 @@ describe('couch-url-rewrite-proxy', function () {
json: true
}, function (err, res, body) {
if (err) return done(err)
res.headers['content-type'].should.equal('application/json; charset=utf-8')
json.done()
Object.keys(body.versions).forEach((version) => {
body.versions[version].dist.tarball.should.match(/http:\/\/www.example.com\/express\/-\/express-.*/)
Expand Down

0 comments on commit f18e456

Please sign in to comment.