MarshallOfSound

#52822: fix: return opaque responses from file and http protocol handlers for cross-origin no-cors requests

Merged
Created: Aug 15, 2026, 4:19:41 PM
Merged: Aug 16, 2026, 5:55:41 AM
5 comments
Target: main

Custom schemes registered with supportFetchAPI: true but without corsEnabled: true should return an opaque response to a cross-origin fetch(url, { mode: 'no-cors' }), the same as protocol.handle. The response was only tagged opaque on the string/buffer/stream path — registerFileProtocol and registerHttpProtocol delivered a readable (basic) response instead.

  • Compute the opaque-response decision once in ElectronURLLoaderFactory::StartLoading and thread it into the file and http loaders.
  • Tag the delivered response head kOpaque on the file and http paths via a small URLLoaderClient interposer, so asar, the plain file loader, and URLPipeLoader all match the buffer/stream path.
  • Add protocol spec coverage for registerFileProtocol and registerHttpProtocol cross-origin no-cors fetches.

Notes: Fixed registerFileProtocol and registerHttpProtocol returning readable responses to cross-origin no-cors fetches; they now return opaque responses like protocol.handle.

Backports

41-x-y
Merged
PR Number
#52854
Merged At
Aug 16, 2026, 8:40:14 AM
Released In
Not yet
Release Date
Not yet
42-x-y
Merged
PR Number
#52855
Merged At
Aug 16, 2026, 2:01:11 PM
Released In
v42.9.2
Release Date
Aug 16, 2026, 2:03:28 PM
43-x-y
Merged
PR Number
#52853
Merged At
Aug 16, 2026, 8:15:35 AM
Released In
Not yet
Release Date
Not yet
44-x-y
Merged
PR Number
#52852
Merged At
Aug 16, 2026, 8:23:41 AM
Released In
Not yet
Release Date
Not yet

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron