• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mozilla / blurts-server / fc5fd966-32ac-4dce-a653-c3228ccbd2bc

pending completion
fc5fd966-32ac-4dce-a653-c3228ccbd2bc

Pull #2762

circleci

GitHub
Merge pull request #2751 from mozilla/MNTOR-1025
Pull Request #2762: Merge `main` into `localization`

282 of 1122 branches covered (25.13%)

Branch coverage included in aggregate %.

203 of 203 new or added lines in 19 files covered. (100.0%)

959 of 3014 relevant lines covered (31.82%)

5.13 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/middleware/util.js
1
// Helps handle errors for all async route controllers
2
// See https://medium.com/@Abazhenov/using-async-await-in-express-with-node-8-b8af872c0016
3
function asyncMiddleware (fn) {
4
  return (req, res, next) => {
×
5
    Promise.resolve(fn(req, res, next)).catch(next)
×
6
  }
7
}
8

9
function bearerToken (req, res, next) {
10
  const [type, token] = req.headers.authorization?.split(' ') || []
×
11
  if (type && type === 'Bearer') {
×
12
    req.token = token
×
13
  } else if (req.query && req.query.token) {
×
14
    req.token = req.query.token
×
15
  }
16
  next()
×
17
}
18

19
export { asyncMiddleware, bearerToken }
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc