Skip to content
This repository has been archived by the owner on Aug 6, 2021. It is now read-only.

Commit

Permalink
Merge pull request #4311 from overleaf/tm-cdn-load-errors
Browse files Browse the repository at this point in the history
Add 1px image from overleaf CDN to layout and report if load fails

GitOrigin-RevId: e1da60d338596db48c0ebb4446bd27e8e1f704ce
  • Loading branch information
das7pad authored and Copybot committed Jul 28, 2021
1 parent 0700ee4 commit 8eab435
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/views/layout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,11 @@ html(
//- Set query param, server will not set CDN url
window.location.search += "&nocdn=true";
}
if hasFeature('saas')
script(type="text/javascript", nonce=scriptNonce).
//- Test for CDN availability and report to sentry if loading failed
var cdnLoadTest = document.createElement('img')
cdnLoadTest.addEventListener('error', function () {
throw new Error('CDN test image load error (cdn.overleaf.net)')
})
cdnLoadTest.src = 'https://cdn.overleaf.net/img/1p.gif'

0 comments on commit 8eab435

Please sign in to comment.