question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CORB message on Chrome 88

See original GitHub issue

Hello

We have set up DD RUM on our web application accordingly to the documentation. However we have faced some issues with ad-blockers, so as a work-around it was decided to proxy all requests targetted to DD through our server so that the URL would always contain our domain. Our default server configuration adds a few headers as a security measure, notably x-content-type-options: nosniff. Raw response from DD:

HTTP/2 200 
content-type: application/json
content-length: 2
access-control-allow-origin: *
date: Tue, 02 Mar 2021 15:19:43 GMT
via: 1.1 google
alt-svc: clear

{}

Response when going through our server:

HTTP/2 200 
date: Tue, 02 Mar 2021 15:11:53 GMT
content-type: application/json
content-length: 2
access-control-allow-origin: *
via: 1.1 google
alt-svc: clear
strict-transport-security: max-age=15724800; includeSubDomains
expect-ct: max-age=86400, enforce
referrer-policy: no-referrer
strict-transport-security: max-age=31536000
x-content-type-options: nosniff
x-frame-options: DENY

{}

When browsing from Chrome, we are noticing a CORB message: dd_rum_corb

According to my understanding, this mecanism triggers because of the presence of X-Content-Type-Options header and because the browser assessed that there is some mismatch between the MIME type being adverdised application/json and the content {}.

The documentation mentions:

Because the JSON syntax is derived from and overlaps with JavaScript, care must be taken to handle the possibility of JavaScript/JSON polyglots. CORB handles the following cases for JSON: […] Other JSON literals: The remaining subset of the JSON syntax (for example, null or [1, 2, “3”]) also happens to be valid JavaScript syntax. In particular, when evaluated as script, they are value expressions that should have no side effects. Thus, if they can be detected, they can be CORB- protected. Detection here is possible, but requires implementing a validator that understands the full JSON syntax: […] If the response is indeed labeled with a JSON Content Type, CORB may decide to sniff the response to confirm it is valid JSON, only up to a certain number of bytes. This would avoid buffering and parsing in an unbounded amount of memory.

I don’t quite understand why this protection fires up as the content seems to be a valid JSON document and matches the MIME type being advertised. Am I missing something?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
BenoitZugmeyercommented, Mar 23, 2022

There is no “mismatch between the MIME type and reality”. This is a Chrome bug as stated here. We might do something about it, but the best solution would be that Chrome fixes the issue.

1reaction
BenoitZugmeyercommented, Mar 23, 2022

Please refer to the documentation

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cross-Origin Read Blocking for Web Developers
When CORB blocks a HTTP response, it emits the following warning message to the DevTools console in Chrome: Cross-Origin Read Blocking (CORB) blocked ......
Read more >
Cross-Origin Read Blocking (CORB) - Stack Overflow
In most cases, the blocked response should not affect the web page's behavior and the CORB error message can be safely ignored.
Read more >
Chrome CORB issue - Pega Documentation
Learn about the Chrome CORB issue and how to address it. ... CORB issues in Chrome occur when the HTML element and the...
Read more >
CORB blocking JSON response after redirect #854 - GitHub
Hey, so I've run into a snag with CORB and how it's handling my fetch POST ... Example fetch() request (taken from Chrome's...
Read more >
I am seeing a Cross-Origin Read Blocking error (CORB) error ...
When sending Algolia Insights events in the Google Chrome browser you may occasionally see warning messages referencing a Cross-Origin Read ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found