Files
cypress/packages/server/lib/util/headers.js
Brian Mann 2333d04a54 secure cookie error crash (#2685)
- fixes #1264 
- fixes #1321 
- fixes #1799  
- fixes #2689
- fixes #2688
- fixes #2687 	
- fixes #2686
2018-11-01 12:34:37 -04:00

22 lines
422 B
JavaScript

const contentType = require('content-type')
module.exports = {
getContentType (res) {
try {
return contentType.parse(res).type
} catch (err) {
return null
}
},
hasContentType (res, type) {
//# does the response object have a content-type
//# that matches what we expect
try {
return contentType.parse(res).type === type
} catch (err) {
return false
}
},
}