We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 182ec17 commit f27487bCopy full SHA for f27487b
templates/web/src/client.ts.twig
@@ -683,6 +683,16 @@ class Client {
683
684
const response = await fetch(uri, options);
685
686
+ // type opaque: No-CORS, different-origin response (CORS-issue)
687
+ if (response.type === 'opaque') {
688
+ throw new {{spec.title | caseUcfirst}}Exception(
689
+ `Invalid Origin. Register your new client (${window.location.host}) as a new Web platform on your project console dashboard`,
690
+ 403,
691
+ "forbidden",
692
+ ""
693
+ );
694
+ }
695
+
696
const warnings = response.headers.get('x-{{ spec.title | lower }}-warning');
697
if (warnings) {
698
warnings.split(';').forEach((warning: string) => console.warn('Warning: ' + warning));
0 commit comments