Merge pull request #6317 from overleaf/jpa-send-explicit-content-type

[web] send explicit content type in responses

GitOrigin-RevId: d5aeaba57a7d2fc053fbf5adc2299fb46e435341
This commit is contained in:
Jakob Ackermann
2022-01-17 10:19:53 +00:00
committed by Copybot
parent c97e95aeba
commit d720d6affa
43 changed files with 390 additions and 224 deletions
@@ -280,9 +280,6 @@ describe('UserMembershipController', function () {
this.req.entity = this.subscription
this.req.entityConfig = EntityConfigs.groupManagers
this.res = new MockResponse()
this.res.contentType = sinon.stub()
this.res.header = sinon.stub()
this.res.send = sinon.stub()
return this.UserMembershipController.exportCsv(this.req, this.res)
})
@@ -295,14 +292,14 @@ describe('UserMembershipController', function () {
})
it('should set the correct content type on the request', function () {
return assertCalledWith(this.res.contentType, 'text/csv')
return assertCalledWith(this.res.contentType, 'text/csv; charset=utf-8')
})
it('should name the exported csv file', function () {
return assertCalledWith(
this.res.header,
'Content-Disposition',
'attachment; filename=Group.csv'
'attachment; filename="Group.csv"'
)
})