Back

12 months ago

Dealing with Cross-Origin Read Blocking (CORB)

  • Lambdas
  • Node
  • APIs

Context

When building Track Titan, it was intended to be used in any of the popular browsers. One day, it was integrated into a gaming platform called Content Manager. The in-built browser appeared to be a version of Chromium and so we assumed everything would "just work".

Problem

The content of the site stopped working and upon looking at the Network calls, I realised it was a "CORBs" issue. I'd encountered CORS many times but never CORBs. The API calls to Sanity (CMS) were getting blocked but other API calls were working fine. I googled around the issue but didn't find anything particularly helpful.

Solution

I was in a bit of a rush to solve this problem, so the way I hacked around it was to create a lambda purely to proxy the call to the Sanity CMS.

Adding that extra API call will be slower, but it solved the core issue and performance wasn't what we were optimising for at the time.